You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Michael Ivanov <iv...@logit-ag.de> on 2015/01/19 15:45:58 UTC
java/c++ messenger interaction
Hallo,
I'm using c++ broker and c++ messageger interface to send the messages.
I am setting the contents of the messages using encode() function
(converts Variant::Map to Message). What should I use on Java side
to decode these messages? How should I send messages from java to
be able to read them in c++ programs using decode()?
I hope it is possible to use c+++ broker with java clients? :-)
Best regards,
--
\ / | |
(OvO) | Mikhail Iwanow |
(^^^) | Voice: +7 (911) 223-1300 |
\^/ | E-mail: ivans@logit-ag.de |
^ ^ | |
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org
Re: java/c++ messenger interaction
Posted by Gordon Sim <gs...@redhat.com>.
On 01/19/2015 02:45 PM, Michael Ivanov wrote:
> Hallo,
>
> I'm using c++ broker and c++ messageger interface to send the messages.
> I am setting the contents of the messages using encode() function
> (converts Variant::Map to Message). What should I use on Java side
> to decode these messages? How should I send messages from java to
> be able to read them in c++ programs using decode()?
>
> I hope it is possible to use c+++ broker with java clients? :-)
Yes, indeed, that should not be a problem. There are two protocol
versions over which that should be possible: AMQP 0-10 and AMQP 1.0.
In qpid::messaging, the encode() and decode() functions are tied to 0-10
encoding. There, the content-type of the message is used to indicate how
the bytes are to be interpreted. In the case of a map, it will be sent
with content-type "amqp/map". This can be read from the AMQP 0-10 JMS
client as a MapMessage.
A more future-proof approach is to instead use the 'content-object'
attribute of a message in qpid::messaging. This can be set to be a
Variant of any type, including a map, and when sent will be encoded
appropriately. This approach should work for both AMQP 0-10 and AMQP 1.0.
(The broker will also convert map messages from 0-10 to 1.0 format if
needed, i.e. if they are sent in one version, but consumed in another)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org