You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by "zhaoyi0113@gmail.com" <zh...@gmail.com> on 2010/09/14 12:08:38 UTC

What is clientid used for?

I found that there is a clientid when creating a AMQConnection. I didn't see
this clientid in AMQP protocol. What is this used for in QPID?
-- 
View this message in context: http://apache-qpid-users.2158936.n2.nabble.com/What-is-clientid-used-for-tp5529641p5529641.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: What is clientid used for?

Posted by "zhaoyi0113@gmail.com" <zh...@gmail.com>.
I am using AMQConnection for that I don't want to use JDNI. Does qpid offer
some API except JNDI? If so I can use these APIs. 
-- 
View this message in context: http://apache-qpid-users.2158936.n2.nabble.com/What-is-clientid-used-for-tp5529641p5536795.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: What is clientid used for?

Posted by Andrew Kennedy <an...@gmail.com>.
On 15 Sep 2010, at 13:45, zhaoyi0113@gmail.com wrote:
> I read some JMS tutorial and found that client id is used as durable
> subscription. So I think it is useless if I don't use durable  
> subscription,
> right? When I create a AMQPConnection, all its constructor require  
> a client
> id parameter. Why is it a mandatory parameter for AMQPConnection?

Because the JMS specification requires it and Qpid adheres to this  
specification. The API for 'javax.jms.Connection' states, among other  
things:

	"The purpose of the client identifier is to associate a connection  
and its objects with a state maintained on behalf of the client by a  
provider. The only such state identified by the JMS API is that  
required to support durable subscriptions."

Additionally, the Connection is created *before* any subscriptions  
(durable or otherwise), producers or consumers are created. There is  
no way of saying "I want a Connection, but I promise never to use it  
with durable subscriptions" in JMS.

You should *not* be using 'AMQPConnection' in your code. You only  
need the Sun provided 'javax.jms.*' interface classes to communicate  
with Qpid unless you have very advanced requirements. Additionally,  
you should be using a 'ConnectionFactory' rather than constructing  
the connection object directly, this will allow you to leverage JNDI  
to manage different connections.

Please have a look at the Qpid documentation here:

	http://qpid.apache.org/books/0.6/Programming-In-Apache-Qpid/html/ 
ch03.html

Andrew.
-- 
-- andrew d kennedy ? do not fold, bend, spindle, or mutilate ;

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


RE: What is clientid used for?

Posted by "zhaoyi0113@gmail.com" <zh...@gmail.com>.
I read some JMS tutorial and found that client id is used as durable
subscription. So I think it is useless if I don't use durable subscription,
right? When I create a AMQPConnection, all its constructor require a client
id parameter. Why is it a mandatory parameter for AMQPConnection?
-- 
View this message in context: http://apache-qpid-users.2158936.n2.nabble.com/What-is-clientid-used-for-tp5529641p5534232.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


RE: What is clientid used for?

Posted by Robbie Gemmell <ro...@gmail.com>.
clientid is a identifier property stipulated by the JMS API, which is the
supported API for our Java client. 

You can find more information on its uses in various JMS tutorials available
from a Google near you, or alternatively in the JMS API itself.

Robbie

> -----Original Message-----
> From: zhaoyi0113@gmail.com [mailto:zhaoyi0113@gmail.com]
> Sent: 14 September 2010 11:09
> To: users@qpid.apache.org
> Subject: What is clientid used for?
> 
> 
> I found that there is a clientid when creating a AMQConnection. I
> didn't see
> this clientid in AMQP protocol. What is this used for in QPID?
> --
> View this message in context: http://apache-qpid-
> users.2158936.n2.nabble.com/What-is-clientid-used-for-
> tp5529641p5529641.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org