FBryant87
FBryant87

Reputation: 4595

Ensuring Azure Service Bus never loses a single message

I have a system where losing messages from Azure Service Bus would be a disaster, that is, the data would be lost forever with no practical means to repair the damage without major disruption.

Would I ever be able to rely on ASB entirely in this situation? (even if it was to go down for hours, it would always come back up with the same messages it was holding when it failed)

If not, what is a good approach for solving this problem where messages are crucial and cannot be lost? Is it common to simply persist the message to a database prior to publishing so that it can be referred to in the event of a disaster?

Upvotes: 0

Views: 1348

Answers (2)

Sean Feldman
Sean Feldman

Reputation: 25994

Azure Service Bus doesn’t lose messages. Once a message is successfully received by the broker, it’s there and doesn’t go anywhere. Where usually things go wrong is with message receiving and processing, which is user custom code. That’s one of the reasons why Service Bus has PeekLock receive mode and dead-lettering based on delivery count.

If you need strong guarantees, don’t reinvent the wheel yourself. Use messaging frameworks that do it for you, such as NServiceBus or MassTransit.

Upvotes: 4

Houssem
Houssem

Reputation: 1072

With azure service bus you can make this and be sure 99.99% percent, at worst case you will find your message at the dead-letter queues but it will be never deleted. enter image description here

Another choice is to use Azure Storage Queue and setting TTL to -1 it will give a infinity life time ,

but because i'am a little bit an old school and to be sure 101% I would suggest an manual solution using azure table storage, so it's you who decide when add/delete or update a ligne because the criticty of information and data that you work with

Upvotes: 1

Related Questions