Defines our custom headers for internal operations
예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RedisQueueSend" /> class.
        /// </summary>
        /// <param name="sentMessageFactory">The sent message factory.</param>
        /// <param name="headers">The headers.</param>
        /// <param name="sendMessage">The send message.</param>
        /// <param name="sendMessageBatch">The send message batch.</param>
        /// <param name="sendMessageAsync">The send message asynchronous.</param>
        /// <param name="sendMessageBatchAsync">The send message batch asynchronous.</param>
        public RedisQueueSend(ISentMessageFactory sentMessageFactory,
                              RedisHeaders headers, ICommandHandlerWithOutput <SendMessageCommand, string> sendMessage, ICommandHandlerWithOutput <SendMessageCommandBatch, QueueOutputMessages> sendMessageBatch, ICommandHandlerWithOutput <SendMessageCommand, Task <string> > sendMessageAsync, ICommandHandlerWithOutput <SendMessageCommandBatch, Task <QueueOutputMessages> > sendMessageBatchAsync)
        {
            Guard.NotNull(() => sentMessageFactory, sentMessageFactory);
            Guard.NotNull(() => headers, headers);
            Guard.NotNull(() => sendMessage, sendMessage);
            Guard.NotNull(() => sendMessageBatch, sendMessageBatch);
            Guard.NotNull(() => sendMessageBatchAsync, sendMessageBatchAsync);
            Guard.NotNull(() => sentMessageFactory, sentMessageFactory);

            _headers               = headers;
            _sendMessage           = sendMessage;
            _sendMessageBatch      = sendMessageBatch;
            _sendMessageAsync      = sendMessageAsync;
            _sendMessageBatchAsync = sendMessageBatchAsync;
            _sentMessageFactory    = sentMessageFactory;
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RedisQueueSend" /> class.
        /// </summary>
        /// <param name="sentMessageFactory">The sent message factory.</param>
        /// <param name="headers">The headers.</param>
        /// <param name="sendMessage">The send message.</param>
        /// <param name="sendMessageBatch">The send message batch.</param>
        /// <param name="sendMessageAsync">The send message asynchronous.</param>
        /// <param name="sendMessageBatchAsync">The send message batch asynchronous.</param>
        public RedisQueueSend(ISentMessageFactory sentMessageFactory,
            RedisHeaders headers, ICommandHandlerWithOutput<SendMessageCommand, string> sendMessage, ICommandHandlerWithOutput<SendMessageCommandBatch, QueueOutputMessages> sendMessageBatch, ICommandHandlerWithOutput<SendMessageCommand, Task<string>> sendMessageAsync, ICommandHandlerWithOutput<SendMessageCommandBatch, Task<QueueOutputMessages>> sendMessageBatchAsync)
        {
            Guard.NotNull(() => sentMessageFactory, sentMessageFactory);
            Guard.NotNull(() => headers, headers);
            Guard.NotNull(() => sendMessage, sendMessage);
            Guard.NotNull(() => sendMessageBatch, sendMessageBatch);
            Guard.NotNull(() => sendMessageBatchAsync, sendMessageBatchAsync);
            Guard.NotNull(() => sentMessageFactory, sentMessageFactory);

            _headers = headers;
            _sendMessage = sendMessage;
            _sendMessageBatch = sendMessageBatch;
            _sendMessageAsync = sendMessageAsync;
            _sendMessageBatchAsync = sendMessageBatchAsync;
            _sentMessageFactory = sentMessageFactory;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RedisQueueReceiveMessagesError"/> class.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <param name="queryGetMetaData">The query get meta data.</param>
        /// <param name="saveMetaData">The save meta data.</param>
        /// <param name="commandMoveRecord">The command move record.</param>
        /// <param name="log">The log.</param>
        /// <param name="headers">The headers.</param>
        public RedisQueueReceiveMessagesError(
            QueueConsumerConfiguration configuration,
            IQueryHandler <GetMetaDataQuery, RedisMetaData> queryGetMetaData,
            ICommandHandler <SaveMetaDataCommand> saveMetaData,
            ICommandHandler <MoveRecordToErrorQueueCommand <string> > commandMoveRecord,
            ILogger log,
            RedisHeaders headers)
        {
            Guard.NotNull(() => configuration, configuration);
            Guard.NotNull(() => queryGetMetaData, queryGetMetaData);
            Guard.NotNull(() => saveMetaData, saveMetaData);
            Guard.NotNull(() => commandMoveRecord, commandMoveRecord);
            Guard.NotNull(() => log, log);
            Guard.NotNull(() => headers, headers);

            _configuration     = configuration;
            _queryGetMetaData  = queryGetMetaData;
            _saveMetaData      = saveMetaData;
            _commandMoveRecord = commandMoveRecord;
            _log     = log;
            _headers = headers;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RedisQueueReceiveMessagesError"/> class.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <param name="queryGetMetaData">The query get meta data.</param>
        /// <param name="saveMetaData">The save meta data.</param>
        /// <param name="commandMoveRecord">The command move record.</param>
        /// <param name="log">The log.</param>
        /// <param name="headers">The headers.</param>
        public RedisQueueReceiveMessagesError(
            QueueConsumerConfiguration configuration,
            IQueryHandler<GetMetaDataQuery, RedisMetaData> queryGetMetaData,
            ICommandHandler<SaveMetaDataCommand> saveMetaData,
            ICommandHandler<MoveRecordToErrorQueueCommand> commandMoveRecord,
            ILogFactory log,
            RedisHeaders headers)
        {
            Guard.NotNull(() => configuration, configuration);
            Guard.NotNull(() => queryGetMetaData, queryGetMetaData);
            Guard.NotNull(() => saveMetaData, saveMetaData);
            Guard.NotNull(() => commandMoveRecord, commandMoveRecord);
            Guard.NotNull(() => log, log);
            Guard.NotNull(() => headers, headers);

            _configuration = configuration;
            _queryGetMetaData = queryGetMetaData;
            _saveMetaData = saveMetaData;
            _commandMoveRecord = commandMoveRecord;
            _log = log.Create();
            _headers = headers;
        }