void Work(RavenTransportMessage message)
        {
            var transportMessage = new TransportMessage(message.Id, message.Headers);

            transportMessage.Body          = message.Body;
            transportMessage.MessageIntent = message.MessageIntent;

            using (var session = RavenFactory.StartSession(transportMessage.Id))
            {
                Exception exception = null;

                try
                {
                    _tryProcessMessage(transportMessage);
                }
                catch (Exception e)
                {
                    exception = e;
                }
                finally
                {
                    RavenFactory.EndSession(transportMessage.Id);
                }

                _endProcessMessage(transportMessage, exception);

                session.Store(message); //attach message to session
                session.Delete(message);
                //message.Destination = "trash";
                session.SaveChanges();
                //session.Advanced.DocumentStore.DatabaseCommands.ForDatabase((session as DocumentSession).DatabaseName).Delete(message.Id, null);
            }
        }
        public void Send(TransportMessage message, SendOptions sendOptions)
        {
            var counter = DateTime.UtcNow.Ticks;
            var ravenTransportMessage = new RavenTransportMessage(message, sendOptions, counter);

            //push all outbound messages to the endpoint db
            RavenFactory.UsingSession(message.CorrelationId, session => session.Store(ravenTransportMessage));
        }