qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: QPid support for AMQP 1.0 in C++
Date Wed, 23 Oct 2013 15:34:53 GMT
On 10/23/2013 04:00 PM, R3DL wrote:
> Hello,
> I am fairly new to the problems of messaging so maybe I misunderstood some
> key concepts, don't hesitate to point that out if you think that's the case.
> I am trying to send and receive message from an ActiveMQ broker using AMQP.
>  From the ActiveMQ documentation I understood they only support AMQP 1.0.
> I tried to run the examples (hello_world.cpp) from the Qpid messaging API
> (qpidc version 0.24) but it sends message using version 0.10 of AMQP rather
> than 1.0, I have the exact same error message as reported here:
> http://mail-archives.apache.org/mod_mbox/qpid-users/201310.mbox/browser
> So first question, is it possible to speak AMQP 1.0 with the C++
> implementation of the Qpid messaging API and if yes how?

Yes. The 1.0 uses the protocol engine from proton, so first you need to 
have that installed where it can be found (if necessary set 
PKG_CONFIG_PATH to find non-standard install). Then re-run cmake for the 
qpid cpp build and rebuild. That will compile the 1.0 support.

Up to and including 0.24, you need to load the 1.0 as a dynamic plugin. 
(If you install, then this will typically happen by default, otherwise 
use QPID_LOAD_MODULE=/path/to/qpid/build/src/amqpc.so).

Finally you have to set the 'protocol' connection option to 'amqp1.0', 
e.g. with the hello_world example and assuming you are in the build 
directory for a 0.24 release:

   QPID_LOAD_MODULE=$(pwd)/src/amqpc.so ./examples/messaging/hello_world 
localhost amq.topic {protocol:amqp1.0}

> For the moment I assumed this was not supported yet so I installed
> Qpid-proton (version 0.5).
> I run the examples (send.c and recv.c), I am able to send and receive
> messages but even if the receiving program displays correctly the message,
> on the server side it remains in a "pending state" as if there was no
> acknowledgment from the consumer.
> I had a look at the Qpid proton API and I did not found any notion of
> session to specify the acknowledgment policy. Am I missing something?

In the proton messenger API, 'acknowledgement' of messages is done by 
specifying a non-zero incoming window and then accepting messages. E.g.

   //enable window at the start:
   pn_messenger_set_incoming_window( messenger, 10);
   //then when a message is received:
   pn_tracker_t tracker = pn_messenger_incoming_tracker(messenger);
   pn_messenger_accept(messenger, tracker, CUMULATIVE);

To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org

View raw message