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


C# IServiceBus.SubscribeConsumer方法代码示例

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


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

示例1: installation_of_infrastructure_objects

        public void installation_of_infrastructure_objects()
        {
            Logger.Info("Installing stuff");
            LocalBus = ServiceBusFactory.New(x => x.ReceiveFrom("loopback://localhost/mt_client"));
            var eventPublisher = new EventPublisher(LocalBus);
            var inMemoryEventStore = new InMemoryEventStore(eventPublisher);
            var aggregateFactory = new AggregateFactory();
            var simpleEventRepository = new SimpleEventRepository(inMemoryEventStore, aggregateFactory);
            LocalBus.SubscribeConsumer(() => new MyEventConsumer(_received));
            LocalBus.SubscribeConsumer(() => new CreateBatchCommandHandler(simpleEventRepository));
            LocalBus.SubscribeConsumer(() => new RequestSeparateDocumentsCommandHandler(simpleEventRepository));
            LocalBus.SubscribeConsumer(() => new RequestClassifyDocumentsCommandHandler(simpleEventRepository));

            //LocalBus.WriteIntrospectionToFile("d:/ws/programmering/quantum/quantum.tests/localbuslog.txt");
            //PipelineViewer.Trace(LocalBus.InboundPipeline);
            //PipelineViewer.Trace(LocalBus.OutboundPipeline);
            //Prep the event store for this aggregate (could've published a CreateBatch command, but then we would be testing that as well)
            simpleEventRepository.Save(new Batch(_aggregateId), Guid.NewGuid(), null);
        }
开发者ID:chribben,项目名称:Quantum,代码行数:19,代码来源:TestSendMessageReceiveEventNoIoC.cs

示例2: Start

        public void Start(IServiceBus bus)
        {
            _bus = bus;
            _bus.SubscribeConsumer<PasswordUpdater>();

            Console.WriteLine(new string('-', 20));
            Console.WriteLine("New Password Client");
            Console.WriteLine("What would you like to set your new password to?");
            Console.Write("New Password:");
            string newPassword = Console.ReadLine();

            Console.WriteLine(new string('-', 20));

            var message = new RequestPasswordUpdate(newPassword);

            _bus.Publish(message);

            Console.WriteLine("Waiting For Reply with CorrelationId '{0}'", message.CorrelationId);
            Console.WriteLine(new string('-', 20));
        }
开发者ID:rajwilkhu,项目名称:MassTransit,代码行数:20,代码来源:ClientService.cs

示例3: Start

 /// <summary>
 /// Called when the service is being started, which is after the service bus has been started.
 /// </summary>
 /// <param name="bus">The service bus</param>
 public void Start(IServiceBus bus)
 {
     _scheduler = _schedulerFactory();
     bus.SubscribeConsumer(() => new TimeoutHandlers(_scheduler));
 }
开发者ID:fivepmtechnology,项目名称:MassTransit-Cluster,代码行数:9,代码来源:SchedulerService.cs


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