本文整理汇总了C#中IBus.StartConsuming方法的典型用法代码示例。如果您正苦于以下问题:C# IBus.StartConsuming方法的具体用法?C# IBus.StartConsuming怎么用?C# IBus.StartConsuming使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IBus
的用法示例。
在下文中一共展示了IBus.StartConsuming方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
Console.WriteLine("*********** Producer ***********");
_bus = Bus.Initialize(config =>
{
});
_bus.StartConsuming();
while (true)
{
Console.WriteLine("Choose a option");
Console.WriteLine("1 Recipient List");
Console.WriteLine("2 Recipient List Reply Sync");
Console.WriteLine("3 Recipient List Reply Async");
Console.WriteLine("4 Recipient List Timeout (Should only receive a reply from Consumer 2)");
var result = Console.ReadLine();
switch (result)
{
case "1":
TestRecipientList();
break;
case "2":
TestRecipientListReplySynch();
break;
case "3":
TestRecipientListReplyAsynch();
break;
case "4":
TestRecipientListReplySynchTimeout();
break;
}
}
}
示例2: Start
private static void Start(string[] args)
{
// Start Bus
_bus = Bus.Initialize(config =>
{
//config.SetThreads(2);
//config.SetContainer(ObjectFactory.Container);
config.SetContainerType<DefaultBusContainer>();
config.SetHost("localhost");
config.TransportSettings.ClientSettings.Add("PrefetchCount", 100);
config.ScanForMesssageHandlers = true;
config.AddBusToContainer = true;
});
_bus.StartConsuming();
_bus.Publish(new TestMsg(Guid.NewGuid()));
}