public void translates_max_attempts()
 {
     var message = new MessagePayload();
     message.Headers.Add(LightningQueuesChannel.MaxAttemptsHeader, 1.ToString());
     message.TranslateHeaders();
     message.MaxAttempts.ShouldBe(1);
 }
 public void empty_when_headers_arent_present()
 {
     var message = new MessagePayload();
     message.TranslateHeaders();
     message.MaxAttempts.ShouldBeNull();
     message.DeliverBy.ShouldBeNull();
 }
 public void translates_deliver_by()
 {
     var now = DateTime.Now;
     var message = new MessagePayload();
     message.Headers.Add(LightningQueuesChannel.DeliverByHeader, now.ToString("o"));
     message.TranslateHeaders();
     message.DeliverBy.ShouldBe(now);
 }
        public void Send(byte[] data, IHeaders headers)
        {
            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();
        }