当前位置: 首页>>代码示例>>C#>>正文


C# BusConfiguration.AutoSubscribe方法代码示例

本文整理汇总了C#中BusConfiguration.AutoSubscribe方法的典型用法代码示例。如果您正苦于以下问题:C# BusConfiguration.AutoSubscribe方法的具体用法?C# BusConfiguration.AutoSubscribe怎么用?C# BusConfiguration.AutoSubscribe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BusConfiguration的用法示例。


在下文中一共展示了BusConfiguration.AutoSubscribe方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        public static void Main(string[] args)
        {
            string clientId = Guid.NewGuid().ToString();
            Client.Connect(clientId, "administrator", "password");

            BusConfiguration busConfiguration = new BusConfiguration();

            busConfiguration.UsePersistence<InMemoryPersistence>();
            busConfiguration.UseTransport<RabbitMQTransport>();
            busConfiguration.AutoSubscribe();

            var bus = Bus.Create(busConfiguration);

            bus.Start();

            while (true)
            {
                _count++;

                foreach (string deviceId in TempSensorDeviceIds.Keys)
                {
                    SimulateDeviceDataTransmission(SensorType.Temperature, Topics.Temperature, deviceId);
                }

                foreach (string deviceId in HumiditySensorDeviceIds.Keys)
                {
                    SimulateDeviceDataTransmission(SensorType.Humidity, Topics.Humidity, deviceId);
                }

                Thread.Sleep(250);
            }
        }
开发者ID:ryanrdl,项目名称:mqtt-rabbitmq-nservicebus-signalr,代码行数:32,代码来源:Program.cs

示例2: AutoSubscribePlainMessages

        void AutoSubscribePlainMessages(BusConfiguration busConfiguration)
        {
            #region AutoSubscribePlainMessages

            busConfiguration.AutoSubscribe().AutoSubscribePlainMessages();

            #endregion
        }
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:8,代码来源:AutoSubscribeSettings.cs

示例3: DoNotAutoSubscribeSagas

        void DoNotAutoSubscribeSagas(BusConfiguration busConfiguration)
        {
            #region DoNotAutoSubscribeSagas

            busConfiguration.AutoSubscribe().DoNotAutoSubscribeSagas();

            #endregion
        }
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:8,代码来源:AutoSubscribeSettings.cs

示例4: AutoSubscribePlainMessages

        public void AutoSubscribePlainMessages()
        {
            #region AutoSubscribePlainMessages

            BusConfiguration busConfiguration = new BusConfiguration();

            busConfiguration.AutoSubscribe().AutoSubscribePlainMessages();

            #endregion
        }
开发者ID:RichieYang,项目名称:docs.particular.net,代码行数:10,代码来源:AutoSubscribeSettings.cs

示例5: DoNotAutoSubscribeSagas

        public void DoNotAutoSubscribeSagas()
        {
            #region DoNotAutoSubscribeSagas

            BusConfiguration busConfiguration = new BusConfiguration();

            busConfiguration.AutoSubscribe().DoNotAutoSubscribeSagas();

            #endregion
        }
开发者ID:RichieYang,项目名称:docs.particular.net,代码行数:10,代码来源:AutoSubscribeSettings.cs

示例6: Customize

        public void Customize(BusConfiguration configuration)
        {
            DefaultFactory defaultFactory = LogManager.Use<DefaultFactory>();
            defaultFactory.Level(LogLevel.Fatal);

            configuration.UseTransport<RabbitMQTransport>();
            configuration.UsePersistence<InMemoryPersistence>();

            configuration.AutoSubscribe();
        }
开发者ID:ryanrdl,项目名称:SagaTimeoutSample,代码行数:10,代码来源:EndpointConfig.cs

示例7: GetBus

        public static IStartableBus GetBus()
        {
            DefaultFactory defaultFactory = LogManager.Use<DefaultFactory>();
            defaultFactory.Level(LogLevel.Fatal);

            var configuration = new BusConfiguration();
            configuration.UseTransport<RabbitMQTransport>();
            configuration.UsePersistence<InMemoryPersistence>();

            configuration.AutoSubscribe();

            var bus = Bus.Create(configuration);
            return bus;
        }
开发者ID:ryanrdl,项目名称:SagaTimeoutSample,代码行数:14,代码来源:BusFactory.cs

示例8: Application_Start

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            BusConfiguration busConfiguration = new BusConfiguration();

            busConfiguration.UsePersistence<InMemoryPersistence>();
            busConfiguration.UseTransport<RabbitMQTransport>();
            busConfiguration.AutoSubscribe();

            var bus = Bus.Create(busConfiguration);

            _.Bus = bus.Start();
        }
开发者ID:ryanrdl,项目名称:mqtt-rabbitmq-nservicebus-signalr,代码行数:18,代码来源:Global.asax.cs


注:本文中的BusConfiguration.AutoSubscribe方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。