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


C# IServiceBus.GetEndpoint方法代码示例

本文整理汇总了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();
		}
开发者ID:vinayreddym,项目名称:MassTransit,代码行数:26,代码来源:SubscriptionClient.cs

示例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.");
        }
开发者ID:trulstveoy,项目名称:Sandbox,代码行数:14,代码来源:SampleCommandSender.cs

示例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();
		}
开发者ID:jimitndiaye,项目名称:MassTransit,代码行数:20,代码来源:SubscriptionClient.cs


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