1

IMessageSession has CloseAsync and CompleteAsync methods.

If CloseAsync and CompleteAsync are not called (after acquiring a session and processing messages), what are the repercussions to the client and to azure service bus account?

Raghu
  • 2,859
  • 4
  • 33
  • 65

2 Answers2

1

The message is not successfully removed from the queue, the default maximum delivery count (retry) is 10. So your receiver can potentially receive the message 10 times, then it's put in deadletter queue (depending on the configuration) where it will stay for 14days (default setting)

For more details: https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dead-letter-queues

Golois Mouelet
  • 307
  • 2
  • 10
1

The approved answer is incorrect. TTL is applicable for the Active Queue, not for the Dead-letter Queue. Secondly, the answer is implementation-specific, one not necessarily needs to use RegisterMessageHandler and can make use of MessageReceiver instead and something else. Basically, CompleteAsync is used for deleting a locked message from the queue (can be DLQ as well) and CloseAsync is for closing the connection object.