Esempio n. 1
0
        public void Handler(object sender, BasicReturnEventArgs e, IPublishedMessageStore publishedMessageStore)
        {
            using (var tx = publishedMessageStore.BeginTransaction())
            {
                string body = Encoding.UTF8.GetString(e.Body);

                RmqPublishMessage returnedMessage = JsonConvert.DeserializeObject <RmqPublishMessage>(body);

                RmqPublishMessage foundMessage = publishedMessageStore.GetByMessageId(returnedMessage.MessageId);

                foundMessage.Status       = MessageStatusConstants.Unroutable;
                foundMessage.StatusReason = e.ReplyText;

                publishedMessageStore.Update(foundMessage);

                publishedMessageStore.Commit(tx);
            }
        }
Esempio n. 2
0
        public ActionResult <string> GetById()
        {
            RmqPublishMessage msg2 = _publishedMessageStore.GetByMessageId(Guid.Parse("c742759a-dbe1-4f54-a97a-dd96feb5deb7"));

            return(JsonConvert.SerializeObject(msg2, Formatting.Indented));
        }