protected BaseSendContext(TMessage message, CancellationToken cancellationToken)
        {
            CancellationToken = cancellationToken;
            Message           = message;

            _payloadCache = new PayloadCache();
            _headers      = new DictionarySendHeaders();

            MessageId = NewId.NextGuid();
            Durable   = true;
        }
Esempio n. 2
0
        protected BaseReceiveContext(Uri inputAddress, bool redelivered, IReceiveObserver receiveObserver)
        {
            _receiveTimer = Stopwatch.StartNew();

            _payloadCache = new PayloadCache();

            InputAddress     = inputAddress;
            Redelivered      = redelivered;
            _receiveObserver = receiveObserver;

            _cancellationTokenSource = new CancellationTokenSource();

            _headers = new Lazy <Headers>(() => new JsonHeaders(ObjectTypeDeserializer.Instance, HeaderProvider));

            _contentType = new Lazy <ContentType>(GetContentType);

            _pendingTasks = new List <Task>();
        }