qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: java/c++ messenger interaction
Date Tue, 20 Jan 2015 15:57:31 GMT
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


Mime
View raw message