private MutableIntegrationMessageBuilder(IMessage message)
        {
            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            _mutableMessage = message is MutableMessage mutableMessage
                ? mutableMessage
                : new MutableMessage(message.Payload, message.Headers);

            _headers = _mutableMessage.RawHeaders;
        }
예제 #2
0
        public static MutableMessageBuilder WithPayload(object payload, bool generateHeaders)
        {
            MutableMessage message;

            if (generateHeaders)
            {
                message = new MutableMessage(payload);
            }
            else
            {
                message = new MutableMessage(payload, new MutableMessageHeaders(null, MessageHeaders.ID_VALUE_NONE, -1L));
            }

            return(FromMessage(message));
        }
예제 #3
0
        private MutableMessageBuilder(IMessage message)
        {
            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            if (message is MutableMessage)
            {
                _mutableMessage = (MutableMessage)message;
            }
            else
            {
                _mutableMessage = new MutableMessage(message.Payload, message.Headers);
            }

            _headers = _mutableMessage.RawHeaders;
        }