qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Quynh Duong <quynhduon...@outlook.com>
Subject RE: qpid cpp pub/sub
Date Thu, 03 Jul 2014 03:42:36 GMT
Hi Gordon,
I have implemented 2 Java JMS consumers based on your suggestion, using "topic://<somestuff>.<someelse>"
and they worked perfectly. You can subscribe to the topics using "*" and "#" with ease. Java
producer produces 2 messages for news and 2 messages for weather, total of 4. Pub/sub model
worked with messages delivered to all JMS subs.
//Java Producer
Destination topic = producersession.createTopic("topic://usa.news");
Destination topic2 = producersession.createTopic("topic://usa.weather");
//Java Producer end
//Java Consumer 1
Destination topic = session.createTopic("topic://*.weather");
//Java Consumer 1 output
Hello weather!
Hello weather!
//Java Consumer 2
Destination topic = session.createTopic("topic://usa.*");
//Java Consumer 2 output
Hello news!
Hello news!
Hello weather!
Hello weather!
//C++ Consumer
string address = "topic://usa.news"; //tried all possible combo including "usa.news" alone
//C++ Consumer output
<nothing>


So based on my observation of the Qpid c++ API, there seems to be a lot of incompatibility
with the JMS API or with JBOSS A-MQ. It can also simply be the case where the c++ implementation
hasn't gone as far as the JMS API.
On a related note, the following connection URL on Java works with JBOSS A-MQ authentication:
amqp://guest:guest@localhost:5672

while c++ connection options:
{username: guest, password: guest, protocol: amqp1.0}
will fail at authentication with message from broker:
username [null] or invalid password

Hope that my observation is correct.
Quynh> Date: Wed, 2 Jul 2014 17:46:01 +0100
> From: gsim@redhat.com
> To: dev@qpid.apache.org
> Subject: Re: qpid cpp pub/sub
> 
> On 07/02/2014 05:29 PM, Quynh Duong wrote:
> > Hi Gordon,
> > Thanks for the prompt reply, I would like to further clarify my problem.
> > I am currently running the QPID JMS client and QPID CPP API against JBOSS A-MQ 6.1
on AMQP 1.0 protocol. I am still having trouble initiating a 1pub/2sub model where the pub
is java and the sub is c++. I have tried different address options however I am still unable
to emulate AMQP "private queue bound to exchange" approach to pub/sub.
> 
> Ok, in that case you need to modify the address so A-MQ knows that it is 
> a 'topic'. Instead of using "news" use "'topic://news'" in the c++ receiver.
> 
> > Also JBOSS A-MQ seems to not like subjects, since every time I add "/<subject>"
to the address, the sub application will fail to receive messages.
> 
> The core AMQP 1.0 specification doesn't defined any standard filters, 
> which is what is needed over 1.0 to do subject filtering. There are some 
> extensions registered under the Apache namespace which is what the c++ 
> client uses for subject matching. However these are not supported by A-MQ.
> 
> (You could use a selector to do filtering instead if needed. There is 
> another extension registered for a JMS-style selector which you can use 
> with the qpid::messaging client and I believe A-MQ supports that filter.)
 		 	   		  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message