Adds system standard headers to out going messages
Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProducerQueueRpc{T}" /> class.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <param name="sendMessages">The send messages.</param>
        /// <param name="responseIdFactory">The response identifier factory.</param>
        /// <param name="messageFactory">The message factory.</param>
        /// <param name="rpcTimeoutFactory">The RPC timeout factory.</param>
        /// <param name="generateMessageHeaders">The generate message headers.</param>
        /// <param name="addStandardMessageHeaders">The add standard message headers.</param>
        public ProducerQueueRpc(
            QueueProducerConfiguration configuration,
            ISendMessages sendMessages,
            IResponseIdFactory responseIdFactory,
            IMessageFactory messageFactory,
            IRpcTimeoutFactory rpcTimeoutFactory,
            GenerateMessageHeaders generateMessageHeaders,
            AddStandardMessageHeaders addStandardMessageHeaders)
        {
            Guard.NotNull(() => configuration, configuration);
            Guard.NotNull(() => sendMessages, sendMessages);
            Guard.NotNull(() => responseIdFactory, responseIdFactory);
            Guard.NotNull(() => messageFactory, messageFactory);
            Guard.NotNull(() => rpcTimeoutFactory, rpcTimeoutFactory);
            Guard.NotNull(() => generateMessageHeaders, generateMessageHeaders);
            Guard.NotNull(() => addStandardMessageHeaders, addStandardMessageHeaders);


            _configuration             = configuration;
            _sendMessages              = sendMessages;
            _responseIdFactory         = responseIdFactory;
            _messageFactory            = messageFactory;
            _rpcTimeoutFactory         = rpcTimeoutFactory;
            _generateMessageHeaders    = generateMessageHeaders;
            _addStandardMessageHeaders = addStandardMessageHeaders;
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProducerQueue{T}" /> class.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <param name="sendMessages">The send messages.</param>
        /// <param name="messageFactory">The message factory.</param>
        /// <param name="log">The log.</param>
        /// <param name="generateMessageHeaders">The generate message headers.</param>
        /// <param name="addStandardMessageHeaders">The add standard message headers.</param>
        public ProducerQueue(
            QueueProducerConfiguration configuration,
            ISendMessages sendMessages,
            IMessageFactory messageFactory,
            ILogFactory log,
            GenerateMessageHeaders generateMessageHeaders,
            AddStandardMessageHeaders addStandardMessageHeaders)
        {
            Guard.NotNull(() => configuration, configuration);
            Guard.NotNull(() => sendMessages, sendMessages);
            Guard.NotNull(() => messageFactory, messageFactory);
            Guard.NotNull(() => log, log);
            Guard.NotNull(() => generateMessageHeaders, generateMessageHeaders);
            Guard.NotNull(() => addStandardMessageHeaders, addStandardMessageHeaders);

            _configuration             = configuration;
            _sendMessages              = sendMessages;
            _addStandardMessageHeaders = addStandardMessageHeaders;

            _messageFactory         = messageFactory;
            _log                    = log.Create();
            _generateMessageHeaders = generateMessageHeaders;
        }