本文整理汇总了C#中IServiceBus.GetEndpoint方法的典型用法代码示例。如果您正苦于以下问题:C# IServiceBus.GetEndpoint方法的具体用法?C# IServiceBus.GetEndpoint怎么用?C# IServiceBus.GetEndpoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IServiceBus
的用法示例。
在下文中一共展示了IServiceBus.GetEndpoint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SubscriptionClient
public SubscriptionClient(IServiceBus bus, SubscriptionRouter router, Uri subscriptionServiceUri,
TimeSpan startTimeout)
{
_bus = bus;
_router = router;
_subscriptionServiceUri = subscriptionServiceUri;
_startTimeout = startTimeout;
_network = router.Network;
if (_log.IsDebugEnabled)
_log.DebugFormat("Starting SubscriptionClient using {0}", subscriptionServiceUri);
VerifyClientAndServiceNotOnSameEndpoint(bus);
_ready.Reset();
var consumerInstance = new SubscriptionMessageConsumer(_router, _network);
_unsubscribeAction = _bus.ControlBus.SubscribeInstance(consumerInstance);
_unsubscribeAction += _bus.ControlBus.SubscribeContextHandler<SubscriptionRefresh>(Consume);
_subscriptionEndpoint = _bus.GetEndpoint(subscriptionServiceUri);
_producer = new SubscriptionServiceMessageProducer(router, _subscriptionEndpoint);
WaitForSubscriptionServiceResponse();
}
示例2: Start
public void Start(IServiceBus serviceBus)
{
Console.WriteLine("Press any key to send command, q to quit");
char key;
do
{
key = Console.ReadKey().KeyChar;
serviceBus.GetEndpoint(new MessageUrn(string.Format("msmq://localhost/{0}", "FooBarServer"))).Send(new SampleCommand { Text = key.ToString(CultureInfo.InvariantCulture) });
} while (key != 'q');
Console.WriteLine("Publish completed.");
}
示例3: Start
public void Start(IServiceBus bus)
{
if (_log.IsInfoEnabled)
_log.InfoFormat("Starting SubscriptionClient on {0}", bus.Endpoint.Address.Uri);
if (_log.IsDebugEnabled)
_log.DebugFormat("Getting endpoint for subscription service at {0}", SubscriptionServiceUri);
_subscriptionServiceEndpoint = bus.GetEndpoint(SubscriptionServiceUri);
VerifyClientAndServiceNotOnSameEndpoint(bus);
_ready.Reset();
_coordinator = new SubscriptionCoordinator(bus.ControlBus, _subscriptionServiceEndpoint, _network, false);
_coordinator.OnRefresh += CoordinatorOnRefresh;
_coordinator.Start(bus);
WaitForSubscriptionServiceResponse();
}