Azure / azure-amqp

AMQP C# library
Other
94 stars 70 forks source link

Inquiry on the use of AMQP Session in Event Hub SDKs #244

Closed minghuaw closed 1 year ago

minghuaw commented 1 year ago

It seems like a new AMQP session is created for every new AMQP sender/receiver link in the dotnet/go/java SDKs. I was wondering if there is any particular reason for this design?

I've had a brief discussion on the dotnet SDK repo (Azure/azure-sdk-for-net#34948), but there doesn't seem to be a clear reason.

Thanks in advance :)

xinchen10 commented 1 year ago

I happen to know a few details in the old SB sdk. There was no specific reason for doing so. If we have to justify the choice, that might be that the SB service does not use the AMQP session level features that much. The AMQP session offers the window-based flow control. If multiple links are created within the same session, they are all subject to the flow control and may interfere with each other. Of course we can turn off session flow control but then creating a session for a link seems just simpler.

The old sdk also has types called QueueClient/TopicClient. In that case it actually creates one session for all sender/receiver links from that client. But those types no longer exist in newer SDKs.

The session is still used by special links. For example a request-response link pair share the same session.

minghuaw commented 1 year ago

Thanks. Does this reasoning also apply to the Event Hubs SDK?

xinchen10 commented 1 year ago

Yes