本文整理汇总了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);
}
}
示例2: AutoSubscribePlainMessages
void AutoSubscribePlainMessages(BusConfiguration busConfiguration)
{
#region AutoSubscribePlainMessages
busConfiguration.AutoSubscribe().AutoSubscribePlainMessages();
#endregion
}
示例3: DoNotAutoSubscribeSagas
void DoNotAutoSubscribeSagas(BusConfiguration busConfiguration)
{
#region DoNotAutoSubscribeSagas
busConfiguration.AutoSubscribe().DoNotAutoSubscribeSagas();
#endregion
}
示例4: AutoSubscribePlainMessages
public void AutoSubscribePlainMessages()
{
#region AutoSubscribePlainMessages
BusConfiguration busConfiguration = new BusConfiguration();
busConfiguration.AutoSubscribe().AutoSubscribePlainMessages();
#endregion
}
示例5: DoNotAutoSubscribeSagas
public void DoNotAutoSubscribeSagas()
{
#region DoNotAutoSubscribeSagas
BusConfiguration busConfiguration = new BusConfiguration();
busConfiguration.AutoSubscribe().DoNotAutoSubscribeSagas();
#endregion
}
示例6: Customize
public void Customize(BusConfiguration configuration)
{
DefaultFactory defaultFactory = LogManager.Use<DefaultFactory>();
defaultFactory.Level(LogLevel.Fatal);
configuration.UseTransport<RabbitMQTransport>();
configuration.UsePersistence<InMemoryPersistence>();
configuration.AutoSubscribe();
}
示例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;
}
示例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();
}