You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by R3DL <je...@gmail.com> on 2013/10/23 17:00:56 UTC

QPid support for AMQP 1.0 in C++

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?

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?

Thank you for your time.



--
View this message in context: http://qpid.2158936.n2.nabble.com/QPid-support-for-AMQP-1-0-in-C-tp7599835.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: QPid support for AMQP 1.0 in C++

Posted by R3DL <je...@gmail.com>.
Thank you for your answers. I will try that.


2013/10/23 Gordon Sim [via Qpid] <ml...@n2.nabble.com>

> 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: [hidden email]<http://user/SendEmail.jtp?type=node&node=7599837&i=0>
> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=7599837&i=1>
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://qpid.2158936.n2.nabble.com/QPid-support-for-AMQP-1-0-in-C-tp7599835p7599837.html
>  To unsubscribe from QPid support for AMQP 1.0 in C++, click here<http://qpid.2158936.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=7599835&code=amVyZW1pZS5zdG9yZGV1ckBnbWFpbC5jb218NzU5OTgzNXwyMDIyMjE1NjA2>
> .
> NAML<http://qpid.2158936.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://qpid.2158936.n2.nabble.com/QPid-support-for-AMQP-1-0-in-C-tp7599835p7600138.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

Re: QPid support for AMQP 1.0 in C++

Posted by Gordon Sim <gs...@redhat.com>.
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