Azure Service Bus Subscriber Deadletter
Asked Answered
P

2

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?

Plyler answered 26/2, 2014 at 23:53 Comment(0)
P
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.

Psychological answered 27/2, 2014 at 9:57 Comment(5)
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?Plyler
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 notPsychological
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?Plyler
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)Psychological
No thanks ok, thanks for the info and the answer. I've got enough to be able to go make something fun! Thanks again! :)Plyler
E
0

I recommend to use TargetSubscription property.

 "Properties": {
    "TargetSubscription": "subscriber2"
  }
Enunciation answered 23/2, 2024 at 12:30 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.