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


C# IAdvancedBus类代码示例

本文整理汇总了C#中IAdvancedBus的典型用法代码示例。如果您正苦于以下问题:C# IAdvancedBus类的具体用法?C# IAdvancedBus怎么用?C# IAdvancedBus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: DeclareExchangeAsync

 public Task<IExchange> DeclareExchangeAsync(IAdvancedBus advancedBus, string exchangeName, string exchangeType)
 {
     return exchangeNames.AddOrUpdate(
         exchangeName,
         name => advancedBus.ExchangeDeclareAsync(name, exchangeType),
         (_, exchange) => exchange);
 }
开发者ID:KristofferV,项目名称:EasyNetQ,代码行数:7,代码来源:VersionedPublishExchangeDeclareStrategy.cs

示例2: Start

        public void Start()
        {
            _log.DebugFormat("Started billing service");

            var container = new WindsorContainer().Install(
                new NHibernateInstaller(),
                new WindsorInstaller(),
                new CacheProviderInstaller(),
                new RepositoryInstaller(),
                new AutoMapperInstaller(),
                new ConsumerInstaller(),
                new BusInstaller(),
                new PublishReportQueueInstaller(),
                new PivotInstaller(),
                new ScheduleInstaller());

            advancedBus = container.Resolve<IAdvancedBus>();
            var q = advancedBus.QueueDeclare("DataPlatform.Transactions.Billing");
            
            advancedBus.Consume(q, x => x
                .Add<InvoiceTransactionCreated>((message, info) => new TransactionConsumer<InvoiceTransactionCreated> (message, container))
                .Add<UserMessage>((message, info) => new TransactionConsumer<UserMessage> (message, container))
                .Add<CustomerMessage>((message, info) => new TransactionConsumer<CustomerMessage>(message, container))
                .Add<ClientMessage>((message, info) => new TransactionConsumer<ClientMessage>(message, container))
                .Add<PackageMessage>((message, info) => new TransactionConsumer<PackageMessage>(message, container))
                .Add<ContractMessage>((message, info) => new TransactionConsumer<ContractMessage>(message, container))
                .Add<TransactionRequestMessage>((message, info) => new TransactionConsumer<TransactionRequestMessage>(message, container))
                .Add<TransactionRequestCleanupMessage>((message, info) => new TransactionConsumer<TransactionRequestCleanupMessage>(message, container)));

            _log.DebugFormat("Billing service started");
        }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:31,代码来源:BillingService.cs

示例3: TransferToBus

        public void TransferToBus(IAdvancedBus advancedBus)
        {
            var rebusEvents = advancedBus.Events;

            if (MessageSent != null)
            {
                foreach (var listener in MessageSent.GetInvocationList().Cast<MessageSentEventHandler>())
                {
                    rebusEvents.MessageSent += listener;
                }
            }

            if (BeforeMessage != null)
            {
                foreach (var listener in BeforeMessage.GetInvocationList().Cast<BeforeMessageEventHandler>())
                {
                    rebusEvents.BeforeMessage += listener;
                }
            }

            if (AfterMessage != null)
            {
                foreach (var listener in AfterMessage.GetInvocationList().Cast<AfterMessageEventHandler>())
                {
                    rebusEvents.AfterMessage += listener;
                }
            }

            if (BeforeTransportMessage != null)
            {
                foreach (var listener in BeforeTransportMessage.GetInvocationList().Cast<BeforeTransportMessageEventHandler>())
                {
                    rebusEvents.BeforeTransportMessage += listener;
                }
            }

            if (AfterTransportMessage != null)
            {
                foreach (var listener in AfterTransportMessage.GetInvocationList().Cast<AfterTransportMessageEventHandler>())
                {
                    rebusEvents.AfterTransportMessage += listener;
                }
            }

            if (PoisonMessage != null)
            {
                foreach (var listener in PoisonMessage.GetInvocationList().Cast<PoisonMessageEventHandler>())
                {
                    rebusEvents.PoisonMessage += listener;
                }
            }

            if (UncorrelatedMessage != null)
            {
                foreach (var listener in UncorrelatedMessage.GetInvocationList().Cast<UncorrelatedMessageEventHandler>())
                {
                    rebusEvents.UncorrelatedMessage += listener;
                }
            }
        }
开发者ID:alexmg,项目名称:Rebus,代码行数:60,代码来源:EventsConfigurer.cs

示例4: Start

        public void Start()
        {
            _log.DebugFormat("Started billing run service");

            var container = new WindsorContainer().Install(
                new NHibernateInstaller(),
                new WindsorInstaller(),
                new CacheProviderInstaller(),
                new RepositoryInstaller(),
                new AutoMapperInstaller(),
                new ConsumerInstaller(),
                new BusInstaller(),
                new PublishReportQueueInstaller(),
                new PivotInstaller(),
                new ReportBuilderInstaller(),
                new NotificationInstaller());

            try
            {
                advancedBus = container.Resolve<IAdvancedBus>();
                var q = advancedBus.QueueDeclare("DataPlatform.Transactions.BillingRun");

                advancedBus.Consume(q, x => x
                    .Add<BillingMessage>((message, info) => new TransactionConsumer<BillingMessage>(message, container)));
            }
            catch (Exception e)
            {
                this.Error(() => e.Message);
            }
            _log.DebugFormat("Billing run service started");
        }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:31,代码来源:BillingRunService.cs

示例5: MessagePublisher

 public MessagePublisher(IAdvancedBus bus, ILogger logger, IExchange exchange, IQueue queue)
 {
     _bus = bus;
     _logger = logger;
     _exchange = exchange;
     _queue = queue;
 }
开发者ID:radicalgeek,项目名称:SampleMicroservice,代码行数:7,代码来源:MessagePublisher.cs

示例6: DeclareExchange

 public IExchange DeclareExchange(IAdvancedBus advancedBus, Type messageType, string exchangeType)
 {
     var conventions = advancedBus.Container.Resolve<IConventions>();
     var messageVersions = new MessageVersionStack( messageType );
     var publishExchange = DeclareVersionedExchanges( advancedBus, conventions, messageVersions, exchangeType );
     return publishExchange;
 }
开发者ID:hmmtry,项目名称:EasyNetQ,代码行数:7,代码来源:VersionedPublishExchangeDeclareStrategy.cs

示例7: SetUp

        public void SetUp()
        {
            mockBuilder = new MockBuilder();
            advancedBus = mockBuilder.Bus.Advanced;

            exchange = advancedBus.ExchangeDeclare("my_exchange", ExchangeType.Direct, passive:true);
        }
开发者ID:siniypin,项目名称:EasyNetQ,代码行数:7,代码来源:ExchangeQueueBindingTests.cs

示例8: when_sending_property_request_to_lace_entry_point

        public when_sending_property_request_to_lace_entry_point()
        {
            _bus = BusFactory.WorkflowBus();

            _request = new PropertyRequestBuilder().ForPropertySources();
            _entryPoint = new EntryPointService(_bus);
        }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:7,代码来源:when_sending_property_request_to_lace_entry_point.cs

示例9: when_sending_company_request_to_lace_entry_point

        public when_sending_company_request_to_lace_entry_point()
        {
            _bus = BusFactory.WorkflowBus();

            _request = new CompanyRequestBuilder().ForLightstoneCompany();
            _entryPoint = new EntryPointService(_bus);
        }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:7,代码来源:when_sending_company_request_to_lace_entry_point.cs

示例10: when_inititializing_lace_source_chain_for_MisMatchlicensePlate_number_search

        public when_inititializing_lace_source_chain_for_MisMatchlicensePlate_number_search()
        {

            _command = BusFactory.WorkflowBus();
            _request = new LicensePlateRequestBuilder().ForAllSourcesWithMisMatchLicensePlate();
            _buildSourceChain = new CreateSourceChain();
        }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:7,代码来源:when_inititializing_lace_source_chain_for_MisMatchlicensePlate_number_search.cs

示例11: Start

        public void Start()
        {
            _bus = BusFactory.CreateAdvancedBus(ConfigurationReader.WorkflowSender);
            var senderQueue = _bus.QueueDeclare("DataPlatform.DataProvider.Sender");
            var senderExchange = _bus.ExchangeDeclare("DataPlatform.DataProvider.Sender", ExchangeType.Fanout);
            _bus.Bind(senderExchange, senderQueue, string.Empty);

            var receiverQueue = _bus.QueueDeclare("DataPlatform.DataProvider.Receiver");
            var receiverExchange = _bus.ExchangeDeclare("DataPlatform.DataProvider.Receiver", ExchangeType.Fanout);
            _bus.Bind(receiverExchange, receiverQueue, string.Empty);

            _bus.Consume(senderQueue, x => x
                .Add<SendRequestToDataProviderCommand>(
                    (message, info) => new SenderCauseFailureConsumers<SendRequestToDataProviderCommand>(message))
                .Add<GetResponseFromDataProviderCommmand>(
                    (message, info) => new SenderCauseFailureConsumers<GetResponseFromDataProviderCommmand>(message))
                .Add<CreateTransactionCommand>(
                    (message, info) => new SenderCauseFailureConsumers<CreateTransactionCommand>(message))
                .Add<ReceiveEntryPointRequest>(
                    (message, info) => new SenderCauseFailureConsumers<ReceiveEntryPointRequest>(message))
                .Add<ReturnEntryPointResponse>(
                    (message, info) => new SenderCauseFailureConsumers<ReturnEntryPointResponse>(message))
                .Add<RaisingSecurityFlagCommand>(
                    (message, info) => new SenderCauseFailureConsumers<RaisingSecurityFlagCommand>(message))
                .Add<ConfiguringDataProviderCommand>(
                    (message, info) => new SenderCauseFailureConsumers<ConfiguringDataProviderCommand>(message))
                .Add<TransformingDataProviderResponseCommand>(
                    (message, info) => new SenderCauseFailureConsumers<TransformingDataProviderResponseCommand>(message))
                .Add<ErrorInDataProviderCommand>(
                    (message, info) => new SenderCauseFailureConsumers<ErrorInDataProviderCommand>(message))
                .Add<StartingCallCommand>(
                    (message, info) => new SenderCauseFailureConsumers<StartingCallCommand>(message))
                .Add<EndingCallCommand>((message, info) => new SenderCauseFailureConsumers<EndingCallCommand>(message)));

            _bus.Consume(receiverQueue, x => x
                .Add<RequestToDataProvider>(
                    (message, info) => new ReceiverCauseFailureConsumers<RequestToDataProvider>(message))
                .Add<EntryPointReceivedRequest>(
                    (message, info) => new ReceiverCauseFailureConsumers<EntryPointReceivedRequest>(message))
                .Add<ResponseFromDataProvider>(
                    (message, info) => new ReceiverCauseFailureConsumers<ResponseFromDataProvider>(message))
                .Add<EntryPointReturnedResponse>(
                    (message, info) => new ReceiverCauseFailureConsumers<EntryPointReturnedResponse>(message))
                //.Add<BillTransactionMessage>(
                //    (message, info) => new ReceiverConsumers<BillTransactionMessage>(message))
                .Add<SecurityFlagRaised>(
                    (message, info) => new ReceiverCauseFailureConsumers<SecurityFlagRaised>(message))
                .Add<DataProviderCallEnded>(
                    (message, info) => new ReceiverCauseFailureConsumers<DataProviderCallEnded>(message))
                .Add<DataProviderCallStarted>(
                    (message, info) => new ReceiverCauseFailureConsumers<DataProviderCallStarted>(message))
                .Add<DataProviderError>(
                    (message, info) => new ReceiverCauseFailureConsumers<DataProviderError>(message))
                .Add<DataProviderResponseTransformed>(
                    (message, info) => new ReceiverCauseFailureConsumers<DataProviderResponseTransformed>(message))
                .Add<DataProviderConfigured>(
                    (message, info) => new ReceiverCauseFailureConsumers<DataProviderConfigured>(message)));

            _log.DebugFormat("Data Provider Command Processor Service Started");
        }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:60,代码来源:IConsumeMessagesToPutOnErrorQueues.cs

示例12: SetUp

        public void SetUp()
        {
            mockBuilder = new MockBuilder();

            connection = mockBuilder.Connection;
            advancedBus = mockBuilder.Bus.Advanced;
        }
开发者ID:hippasus,项目名称:EasyNetQ,代码行数:7,代码来源:BlockedConnectionNotificationTests.cs

示例13: when_inititializing_lace_source_chain_for_vin_rgt_mm_code_search

        public when_inititializing_lace_source_chain_for_vin_rgt_mm_code_search()
        {

            _command = BusFactory.WorkflowBus();
            _request = new LicensePlateMmCodeRequestBuilder().ForIvidRgtVinMmCode();
            _buildSourceChain = new CreateSourceChain();
        }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:7,代码来源:when_inititializing_lace_source_chain_for_vin_rgt_mm_code_search.cs

示例14: when_sending_director_request_to_lace_entry_point

        public when_sending_director_request_to_lace_entry_point()
        {
            _bus = BusFactory.WorkflowBus();

            _request = new DirectorRequestBuilder().ForLightstoneDirector();
            _entryPoint = new EntryPointService(_bus);
        }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:7,代码来源:when_sending_director_request_to_lace_entry_point.cs

示例15: when_initalizing_lace_source_chain_for_vin_rgt_vin_rgt_search

        public when_initalizing_lace_source_chain_for_vin_rgt_vin_rgt_search()
        {

            _command = BusFactory.WorkflowBus();
            _request = new VinRequestBuilder().ForRgtAndRgtVin();
            _buildSourceChain = new CreateSourceChain();
        }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:7,代码来源:when_initalizing_lace_source_chain_for_vin_rgt_vin_rgt_search.cs


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