Service Bus - Singleton Connection Class?

喜夏-厌秋 提交于 2019-11-29 07:33:44

The default underlying protocol used by the Service Bus SDK is the proprietary SBMP (Service Bus Messaging Protocol) that works on top of a TCP/IP connection that is closed when you close the factory. If you choose to use TransportType=Amqp (in the connection string) you can switch to the AMQP protocol. In that case, the factory handles the unique TCP connection to the bus and the QueueClient, TopicClient classes (created from the factory) instantiate a session and a link inside the above TCP connection. Session and link are two AMQP concepts used to multiplex on the single TCP connection. If you close only QueueClient and TopicClient, the closing operation closes only related session and link but not the TCP connection that is closed when you close the factory object. Of course I don't know how SBMP works internally because it's a proprietary protocol. However, in a dispose you could close factory and related queue/topic objects. What's your problem ?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!