1

Background:

I can read messages from a Dead Letter Queue of a subscription. I gather them in a List and set receiver.complete(message.getLockToken()), which removes the message from DLQ.

And later on, I iterate through this list of gathered messages from DLQ and send them back to topic. At the time of putting them into a List, I do make sure that I create a new object of Message (or BrokeredMessage) before putting it in.

This is all well and good for my own personal account. I see numbers go up. I can also read them fine in another method.

Problem:

I don't know where the messages are ending up when I connect to my company's Topic? They don't go to any subscription. And I don't see any number going up (active count, dead letter count, etc).

Question:

Could this be because no rule is able to process those messages, so they are auto purged? Is this a possibility?

J_D
  • 740
  • 8
  • 17
Faraz
  • 6,025
  • 5
  • 31
  • 88
  • Can you provide more details on how you setup the Comapny topic? – kagami May 03 '19 at 17:43
  • @AresOu, hello, thank you for looking into my question. I think I got some of it figured out myself. Thanks though. – Faraz May 05 '19 at 20:44
  • Please write down your findings in answer section and accept it as it will help others in the community. – Mohit Verma May 06 '19 at 10:21
  • @MohitVerma-MSFT - done. thanks – Faraz May 06 '19 at 12:40
  • To answer your question, the same would happen as if you had no subscriptions. Refer [this thread](https://stackoverflow.com/questions/40613216/messages-sent-to-topic-are-getting-lost-if-no-subscriptions-are-specified) for more details. – PramodValavala May 07 '19 at 13:37
  • @PramodValavala-MSFT thank you. It answers my question. – Faraz May 07 '19 at 17:55
  • I found this comment in my code...maybe it applies : /* Microsoft does NOT support moving the message to a subscription directly :( * https://feedback.azure.com/forums/216926-service-bus/suggestions/9295470-resubmit-dead-letter-message-back-to-the-subscript * https://stackoverflow.com/questions/22096262/send-message-directly-to-subscription */ – granadaCoder Aug 20 '19 at 18:51

1 Answers1

0

The solution is trivial and is already spread across stackoverflow.

When I was making a new message object new Message(oldMessage), it was copying all the properties from the old message including DeadLetterReason and DeadLetterErrorDescription. You can get properties by calling this message msg.getProperties().

This is the reason why messages were going into the ether. I stopped it from copying over, and this resolved the issue.

On a side note, I have found the answer to my actual question on this link as suggested by @PramodValavala-MSFT

This was my original question: Could this be because no rule is able to process those messages, so they are auto purged? Is this a possibility?

Faraz
  • 6,025
  • 5
  • 31
  • 88