1
votes

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?

1
Can you provide more details on how you setup the Comapny topic?Ares Ou
@AresOu, hello, thank you for looking into my question. I think I got some of it figured out myself. Thanks though.Faraz
Please write down your findings in answer section and accept it as it will help others in the community.Mohit Verma
@MohitVerma-MSFT - done. thanksFaraz
To answer your question, the same would happen as if you had no subscriptions. Refer this thread for more details.PramodValavala-MSFT

1 Answers

0
votes

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?