Azure / azure-amqp

AMQP C# library
Other
94 stars 70 forks source link

FaultTolerantAmqpObject<SendingAmqpLink>.TryGetOpenedObject (out T openedAmqpObject) Failures and recovery recommendations. #167

Closed azabbasi closed 3 years ago

azabbasi commented 4 years ago

Hello

We use the Microsoft.Azure.Amqp library for all AMQP related operation for Microsoft.Azure.Devices client library.

We have been getting some issues logged against us regarding the SendAsync operation You can see the code here: https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/service/src/AmqpServiceClient.cs

As part of instantiation for this client, we use FaultTolerantAmqpObject object to get opened Sending link and it occasionally fails and that causes the service client to be in a useless state and we have been recommending that our customers dispose their current client and instantiating a new one to get around the issue.

We would like to know more about the reasons behind failures on this operation Further more, if this is something that is expected, what are the recommendations for us in handling such scenarios? should we retry the TryGetOpenedObject operation? is there anyway to recover from such failures?

We would really appreciate any help with this as we have customers blocked by this issue at the moment.

xinchen10 commented 3 years ago

TryGetOpenedObject returns false if there is no link created or the link is already closed. In that case you call GetOrCreateAsync to get a new link.