You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Maurice <ma...@betzel.net> on 2014/06/14 12:52:24 UTC

Camel JMS Spring Remoting and Google Protocol Buffers

Dear Community,

i am successfully using Camel with Spring remoting over JMS using the
default Java serialization. The interface used: String decode(byte[]image,
String BarcodeType, String charset).
Now i have to add access for a CPP using CMS client and the best cross
language structure serializer that comes to mind is Google's Protocol
Buffers.
Nothing to it i thought, interface used: byte[] decode (byte[]pb_structure),
but this is a no go.
The images received are corrupted after deserialization, and sometimes a
array out of bounds exception is thrown. Locally serializing and
deserializing the Protocol Buffer structure works like a charm, also in
Java, so something on the way to the Consumer mangles the byte array. The
fact that the byte array in the first interface does not get mangled has me
puzzled.
Maybe Camel/Spring not send the JMS message as bytes but as String, getting
in conflict with the encoding?



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JMS-Spring-Remoting-and-Google-Protocol-Buffers-tp5752302.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel JMS Spring Remoting and Google Protocol Buffers

Posted by Maurice <ma...@betzel.net>.
OK, i have solved the problem and it is not a Camel or ActiveMQ but a
Protocol Buffers issue.
I do not understand the problem yet but this does not work with ZXing:


But if i do this it decoding works



Only by creating a local reference to a copy of an internal byte array of
ByteString.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JMS-Spring-Remoting-and-Google-Protocol-Buffers-tp5752302p5752325.html
Sent from the Camel - Users mailing list archive at Nabble.com.