本文整理汇总了C#中IAdvancedBus.QueueDeclare方法的典型用法代码示例。如果您正苦于以下问题:C# IAdvancedBus.QueueDeclare方法的具体用法?C# IAdvancedBus.QueueDeclare怎么用?C# IAdvancedBus.QueueDeclare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAdvancedBus
的用法示例。
在下文中一共展示了IAdvancedBus.QueueDeclare方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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");
}
示例2: OutboundServiceBus
static OutboundServiceBus()
{
Bus = MessageBusFactory.CreateBus(ConfigurationManager.ConnectionStrings["rabbitMQ"].ConnectionString);
RequestPublisher = new ExchangePublisher<CreateValueInstructionFileRequest>(Bus);
// TODO: read from config
RequestPublisher.Declare("lombard.service.outclearings.createvalueinstructionfile.request");
RequestQueue = Bus.QueueDeclare("lombard.service.outclearings.createvalueinstructionfile.request.queue");
ResponseQueue = Bus.QueueDeclare("lombard.service.outclearings.createvalueinstructionfile.response.queue");
}
示例3: 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");
}
示例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");
}
示例5: VifBus
static VifBus()
{
Bus = MessageBusFactory.CreateBus(ConfigurationHelper.RabbitMqConnectionString);
RequestExchange = new ExchangePublisher<SendBatchValueInstructionFileRequest>(Bus);
Queue = Bus.QueueDeclare(ConfigurationHelper.VifResponseQueueName);
}
示例6: ValidateCodelineBus
static ValidateCodelineBus()
{
Bus = MessageBusFactory.CreateBus(ConfigurationHelper.RabbitMqConnectionString);
RequestExchange = new ExchangePublisher<ValidateBatchCodelineRequest>(Bus);
Queue = Bus.QueueDeclare(ConfigurationHelper.ValidateCodelineResponseQueueName);
}
示例7: GenerateCorrespondingVoucherBus
static GenerateCorrespondingVoucherBus()
{
Bus = MessageBusFactory.CreateBus(ConfigurationHelper.RabbitMqConnectionString);
RequestExchange = new ExchangePublisher<GenerateCorrespondingVoucherRequest>(Bus);
Queue = Bus.QueueDeclare(ConfigurationHelper.GenerateCorrespondingVoucherResponseQueueName);
}
示例8: AutoReadCarBus
static AutoReadCarBus()
{
Bus = MessageBusFactory.CreateBus(ConfigurationHelper.RabbitMqConnectionString);
InboundExchange = new ExchangePublisher<RecogniseBatchCourtesyAmountRequest>(Bus);
Queue = Bus.QueueDeclare(ConfigurationHelper.OutboundQueueName);
}
示例9: GetVouchersInformationBus
static GetVouchersInformationBus()
{
Bus = MessageBusFactory.CreateBus(ConfigurationHelper.RabbitMqConnectionString);
ResponseExchange = new ExchangePublisher<GetVouchersInformationResponse>(Bus);
RequestQueue = Bus.QueueDeclare(ConfigurationHelper.GetPoolVouchersQueueName);
}
示例10: CreateAdjustmentLettersBus
static CreateAdjustmentLettersBus()
{
Bus = MessageBusFactory.CreateBus(ConfigurationHelper.RabbitMqConnectionString);
RequestExchange = new ExchangePublisher<CreateBatchAdjustmentLettersRequest>(Bus);
Queue = Bus.QueueDeclare(ConfigurationHelper.ResponseQueueName);
}
示例11: OutboundServiceBus
static OutboundServiceBus()
{
Bus = MessageBusFactory.CreateBus(ConfigurationManager.ConnectionStrings["rabbitMQ"].ConnectionString);
RequestPublisher = new ExchangePublisher<CreateImageExchangeFileRequest>(Bus);
RequestPublisher.Declare("lombard.service.outclearings.createimageexchangefile.request");
ResponseQueue = Bus.QueueDeclare("lombard.service.outclearings.createimageexchangefile.response.queue");
}
示例12: CheckThirdPartyBus
static CheckThirdPartyBus()
{
Bus = MessageBusFactory.CreateBus(ConfigurationHelper.RabbitMqConnectionString);
RequestExchange = new ExchangePublisher<CheckThirdPartyBatchRequest>(Bus);
Queue = Bus.QueueDeclare(ConfigurationHelper.CheckThirdPartyResponseQueueName);
}
示例13: CorrectTransactionBus
static CorrectTransactionBus()
{
Bus = MessageBusFactory.CreateBus(ConfigurationHelper.RabbitMqConnectionString);
RequestExchange = new ExchangePublisher<CorrectBatchTransactionRequest>(Bus);
Queue = Bus.QueueDeclare(ConfigurationHelper.CorrectTransactionResponseQueueName);
}
示例14: OutboundServiceBus
static OutboundServiceBus()
{
Bus = MessageBusFactory.CreateBus(ConfigurationManager.ConnectionStrings["rabbitMQ"].ConnectionString);
requestPublisher = new ExchangePublisher<ExecuteBatchReportRequest>(Bus);
// TODO: read from config
requestPublisher.Declare("lombard.service.reporting.executereport.request");
ResponseQueue = Bus.QueueDeclare("lombard.service.reporting.executereport.response.queue");
}
示例15: SetUp
public void SetUp()
{
mockBuilder = new MockBuilder();
advancedBus = mockBuilder.Bus.Advanced;
queue = advancedBus.QueueDeclare(
"my_queue",
passive: false,
durable: false,
exclusive: true,
autoDelete: true,
perQueueTtl: 1000,
expires: 2000);
}