Question

It´s weird and I´m not sure but sometime ago I remember I do something like this

SubscriptionClient Client = SubscriptionClient.CreateFromConnectionString(this._connectionString, topicName, subscription);
BrokeredMessage message = Cient.Receive(TimeSpan.MaxValue);

And the call that days returns in max a minute the null or a message

But the specific question is, I want to know which is the maxtime by default a server response can wait (service bus), until it returns a message even if it is null

Also I know Timespan.MaxValue is the value to wait that I´m indicating, but I really need to know if i put maxvalue (a lot of time not to wait until it finish and discover it), when does Azure will get the return of the message

Was it helpful?

Solution

From an API perspective you can pass in any TimeSpan value and it will be accepted. The reasons for it to return sooner than you have specified even when there is no message could be network glitches, service side updates etc.

The time you decide to put there should be based on how often you expect messages and also when you want control back to be able to cleanly shutdown your client process. Say you expect messages every minute then setting a timeout of 5 minutes and getting a null back could indicate that the system is not healthy. Also say you are shutting down the service, you want to not call the next receive and want all the pending ones to complete and that way you can limit the timeout to a couple minutes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top