Hi Leon,

As you have noticed a pure Java implementation of the Data interface is not
yet available (I think I have a 30% complete implementation sitting
somewhere on an old laptop, but I never got round to finishing it).  It
will get implemented eventually, but it's not currently being worked on as
far as I know.

The Java implementation was built upon a codec which serializes objects in
Java form into AMQP binary data. On the Java implementation of the Message
class there is a method setBody(Section body).  So, in Java, to send an
"amqp value" message containing a map, you could do something like:

import org.apache.qpid.proton.amqp.messaging.AmqpValue;
import org.apache.qpid.proton.amqp.Symbol;

...

Map map = new LinkedHashMap();
map.put("symbol", Symbol.valueOf("a symbol"));
map.put("int", 21);
...
AmqpValue body = new AmqpBody(map);

message.setBody(body);

Hope this helps,
Rob


On 14 June 2013 15:22, Leon Mlakar <l...@digiverse.si> wrote:

> Hello everybody,
>
> I've been following this list for quite a while but so far had no reason
> to take part in discussions.
>
> However, these days I'm porting some C++ code that is using Proton-C to
> talk to peers to Java. The C++ code uses pn_data_put_* functions from
> codec module to compose the body of the message and pn_data_get_*
> counterparts to decompose it at the other end.
>
> In Java, the Proton-Api's Data interface (org.apache.qpid.proton.codec)
> seems to provide the same functionality. But as far as I could see no
> class is actually implementing the interface, and the
> DataFactoryImpl.createData(**long) is only throwing the exception which
> indicates that this operation is not supported. I've seen this in both
> 0.4 package and on the Git's trunk.
>
> Is this a part of functionality that is merely not implemented yet, or
> something that is not planned to get implemented at all? In either case,
> what would be the alternate methods to put together the message body in
> a way that could be understood by C++ code? And vice versa?
>
> The use of Java bindings to Proton-C is not the preferred way to go.
>
> Thanks and best regards,
>
> Leon
>
>

Reply via email to