views:

38

answers:

1

I'm trying to learn more information on how apache Qpid works and I do so by following examples from official svn :

http://svn.apache.org/repos/asf

I was looking at :

http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/example/src/main/java/org/apache/qpid/example/Hello.java

Which uses this configuration/property file :

http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/example/src/main/java/org/apache/qpid/example/hello.properties

Can someone break down to me what this line from configuration represents :

connectionfactory.qpidConnectionfactory = amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672

i. I assume guest:guest would be the credentials which to use when connecting to the qpid

ii. I assume localhost and 5672 should be hostname:port

My question is what does test? represent ? is that a name of the queue or what is it? is it possible to specify queue name directly in this amqp url ?

+1  A: 

Short answer: "test" stands for Qpid virtual host.

Longer answer: this whole HelloWord sample is explained here, line-by-line. From that page, there is a link to Apache Qpid JNDI Properties for AMQP Messaging that explains the URL format:

In JNDI properties, a Connection URL specifies properties for a connection. The format for a Connection URL is:

amqp://[<user>:<pass>@][<clientid>]<virtualhost>[?<option>='<value>'[&<option>='<value>']]

For instance, the following Connection URL specifies a user name, a password, a client ID, a virtual host ("test"), a broker list with a single broker, and a TCP host with the host name “localhost” using port 5672:

amqp://username:password@clientid/test?brokerlist='tcp://localhost:5672'

Virtual hosts are configured in virtualhosts.xml.

Neeme Praks
@Neeme what if I send the message to non existing virtualhost will it be created dynamically ? +1
London
I do not have such experience, but I would guess not. But feel free to try it out! ;-)
Neeme Praks
@Neeme can you recommend some useful tips for learning qPid
London
qPid homepage has excellent resources and there are also some books available for free: http://qpid.apache.org/books/
Neeme Praks