public void requeues_then_moves_to_error_queue()
        {
            Wait.Until(() => TestMessageRecorder.HasProcessed(message1)).ShouldBeTrue();
            Wait.Until(() => TestMessageRecorder.AllProcessed.Length == 5).ShouldBeTrue();

            var scope   = _queueManager.BeginTransactionalScope();
            var message = scope.Receive(LightningQueuesTransport.ErrorQueueName, 5.Seconds());

            message.ShouldNotBeNull();


            var report = ErrorReport.Deserialize(message.Data);

            message.Headers.Get("ExceptionType").ShouldEqual("System.InvalidOperationException");
            report.RawData.ShouldNotBeNull();
        }
Exemplo n.º 2
0
        public static void Send(this IQueueManager queueManager, byte[] data, IHeaders headers, Uri address)
        {
            var messagePayload = new MessagePayload
            {
                Data    = data,
                Headers = headers.ToNameValues()
            };

            //TODO Maybe expose something to modify transport specific payloads?
            messagePayload.TranslateHeaders();

            var sendingScope = queueManager.BeginTransactionalScope();
            var id           = sendingScope.Send(address, messagePayload);

            // TODO -- do we grab this?

            //data.CorrelationId = id.MessageIdentifier;
            sendingScope.Commit();
        }