I am designing a queue based system for decoupling publisher of certain messages from their consumers. I have an additional requirement - when a publisher pushes a new message and if an earlier message of similar kind is already in queue and is yet to be processed(ie picked by consumer) , then the older message has to be deduped off before the new message is pushed into the queue; this is to save on cost of processing a message which we know is getting obsolete. I am exploring on the technology to be used to implement such a queue. Is Azure Service bus an option? Does it allow modifying attributes of specific messages in the queue? Also, any suggestion on what would be the best technology to implement such a queue?
0
votes
What you would like to happen when the older message has been already processed and "new message of similar kind" is being added?
– b2zw2a
@plentysmart in that case, the new message would have to be simply added to the queue. dedup logic would have to look only for those messages that are in queue and are yet to be processed
– Aadith Ramia
1 Answers
0
votes
Try using sessions: https://code.msdn.microsoft.com/windowsazure/Brokered-Messaging-Session-41c43fb4
This way the second message has the same session ID, and the client will fetch all messages with the same session ID. The client must have some logic to discard the oldest one.