/// <summary> /// Initializes a new instance of the <see cref="MessagingConfiguration"/> class. /// </summary> /// <param name="messageStore">The message store.</param> /// <param name="asyncMessageStore">The message store that supports async/await.</param> /// <param name="messageProducer">The messaging gateway.</param> /// <param name="asyncmessageProducer">The messaging gateway that supports async/await.</param> /// <param name="messageMapperRegistry">The message mapper registry.</param> /// <param name="messageStoreWriteTimeout">How long to wait when writing to the message store</param> /// <param name="messagingGatewaySendTimeout">How long to wait when sending via the gateway</param> public MessagingConfiguration( IAmAMessageStore<Message> messageStore, IAmAnAsyncMessageStore<Message> asyncMessageStore, IAmAMessageProducer messageProducer, IAmAnAsyncMessageProducer asyncmessageProducer, IAmAMessageMapperRegistry messageMapperRegistry, int messageStoreWriteTimeout = 300, int messagingGatewaySendTimeout = 300 ) { MessageStore = messageStore; AsyncMessageStore = asyncMessageStore; MessageProducer = messageProducer; AsyncMessageProducer = asyncmessageProducer; MessageMapperRegistry = messageMapperRegistry; MessageStoreWriteTimeout = messageStoreWriteTimeout; MessagingGatewaySendTimeout = messagingGatewaySendTimeout; }
/// <summary> /// The <see cref="CommandProcessor"/> wants to support <see cref="CommandProcessor.Post{T}(T)"/> or <see cref="CommandProcessor.Repost"/> using Task Queues. /// You need to provide a policy to specify how QoS issues, specifically <see cref="CommandProcessor.RETRYPOLICY "/> or <see cref="CommandProcessor.CIRCUITBREAKER "/> /// are handled by adding appropriate <see cref="Policies"/> when choosing this option. /// /// </summary> /// <param name="configuration">The Task Queues configuration.</param> /// <returns>INeedARequestContext.</returns> public INeedARequestContext TaskQueues(MessagingConfiguration configuration) { _useTaskQueues = true; _messageStore = configuration.MessageStore; _asyncMessageStore = configuration.AsyncMessageStore; _messagingGateway = configuration.MessageProducer; _asyncMessagingGateway = configuration.AsyncMessageProducer; _messageMapperRegistry = configuration.MessageMapperRegistry; _messageStoreWriteTimeout = configuration.MessageStoreWriteTimeout; _messagingGatewaySendTimeout = configuration.MessagingGatewaySendTimeout; return this; }