开发者

what is the use of ClientId in the activemq connectionfactory class

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜