开发者

what is the use of ClientId in the activemq connectionfactory class

开发者 https://www.devze.com 2023-04-09 00:53 出处:网络
Scenario : private readonly IConnection con开发者_如何学Gonection; this.connection = connectionFactory.CreateConnection();

Scenario :

private readonly IConnection con开发者_如何学Gonection;
this.connection = connectionFactory.CreateConnection();
this.connection.ClientId = clientId;


The client id is used to logically identify a connection for the purposes of durable subscriptions, and can generally be ignored otherwise. Durable subscriptions allow a client to disconnect/fall over while consuming a topic, and retrieve any messages that it missed when it reconnects. To achieve this, the broker needs this client id to identify which messages are pending consumption. See http://activemq.apache.org/how-do-durable-queues-and-topics-work.html

Although if you want this sort of functionality, a better alternative exists in ActiveMQ in the form of virtual destinations.

0

精彩评论

暂无评论...
验证码 换一张
取 消