6

I've looked everywhere for information on this but can't seem to find what i'm looking for.

I've got an azure topic, with one subscription.

The handler for the subscription failed some messages, they've been put on the deadletter queue.

I can access the messages but i'm at a loss for how to restore them.

I don't want to create a copy of the message and send it to the topic. I specifically want to move it to the subscription queue it came from.

Is there any way to do this?

Jamez
  • 1,559
  • 1
  • 15
  • 26

1 Answers1

2

I don't know if this is possible. What we mostly do to handle & resume messages, is to use the pattern of defering messages. If a handler fails a message, he can then defer the message and keep track of the messagesequence number (typically in a management / tracking database or component). Whenever the message needs to be reprocessed (retried), a receiver can then specifically get that message (using the same defered message id) and process it again.

Sam Vanhoutte
  • 3,247
  • 27
  • 48
  • Thanks for your answer, I did think of deferring the messages but I wasn't sure if that was a good approach to take, If the messagesequence number is lost can you recover from that? – Jamez Feb 27 '14 at 10:48
  • to use this pattern, you indeed need to keep books, somewhere. we do this in a table and expose this through a management interface (web page), where we can trigger retries, etc. i also know you can peek through all messages, so maybe there you can check if a message has been defered already or not – Sam Vanhoutte Feb 27 '14 at 11:59
  • Thanks very much, I'll play around with this approach. Do you happen to know if deferred messages stay on the queue they were deferred on with an altered state or if they're moved to a deferred queue? – Jamez Feb 27 '14 at 13:19
  • they stay on the same queue. i believe you'll be able to read their state on the message object. if you want, I can make a sample of this (but not in the short term) – Sam Vanhoutte Feb 27 '14 at 14:39
  • 1
    No thanks ok, thanks for the info and the answer. I've got enough to be able to go make something fun! Thanks again! :) – Jamez Feb 27 '14 at 22:07