On Wed, Sep 25, 2013 at 11:35 PM, Steven Turner <steventurner...@gmail.com>wrote:
> Hi ActiveMQ team, > > Could somebody please help me understand the format of ActiveMQ connection > id and client id. For example, I see this line in broker logs. > > 20130926 11:52:52:284 IST (ActiveMQ Transport: > tcp:///10.240.170.64:40739@61616) > org.apache.activemq.broker.util.LoggingBrokerPlugin 188 INFO - Adding > Connection : ConnectionInfo {commandId = 1, responseRequired = true, > connectionId = ID:desh0041.hyd-32812-1380176571908-1:1, clientId = > ID:desh0041.hyd-32812-1380176571908-0:1, clientIp = > tcp://10.240.170.64:40739, userName = test, password = *****, brokerPath = > null, brokerMasterConnector = false, manageable = true, clientMaster = > true, > faultTolerant = true, failoverReconnect = false}. > > I would like to understand what are the different attributes in connection > id and client id here apart from the client's host name. For example, 32812 > here is neither client's port nor its process id. What does it represent? > It's a randomly generated number. It's gathered by picking a random port. > What does 1380176571908 represent here? > It's the time in milliseconds on the system that started using ActiveMQ's ID Generator > Why are they not same here? Because two different id generators are used. They have two different meanings. > connectionId = ID:desh0041.hyd-32812-1380176571908-1:1 > clientId = ID:desh0041.hyd-32812-1380176571908-0:1 > > Please also help me understand the following: > 1. Is connection id and client id guaranteed to be unique for every client > (producer or consumer) in every run? Can I assume that at no times two > connection ids/client ids will be same? > ConnectionIDs are guaranteed to be unique for every connection. You can have a multiplicity of producers/consumers per connection. ClientIDs aren't necessarily unique across all connections because they can be set by the client on the ConnectionFactory. > 2. Are these created on the broker side or created on the client side? > Client side for JMS. Server side for STOMP. > 3. I see some difference in connection id and client id for JMS and STOMP > clients? For example, the connection id for jms client has client host in > it > but connection id for stomp client has broker host in it? Why this > difference and inconsistency? Please help me understand. > Shouldn't be. The code on client for JMS connection: connectionIdGenerator = new IdGenerator(); code for stomp connection on server: private static final IdGenerator CONNECTION_ID_GENERATOR = new IdGenerator(); > > Thanks a ton! > > -Steven > > > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/Query-about-ActiveMQ-connection-id-and-client-id-format-tp4671843.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > -- *Christian Posta* http://www.christianposta.com/blog twitter: @christianposta