You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by baklarz <td...@gmail.com> on 2011/07/15 09:48:36 UTC

Proper way to process route protobuf/protocolbuffers

I get protobuf objects from activemq queue. I get messages in byte[] from
activemq.
I generate class from *.proto files ?


@Consume(uri="activemq:PostEvent.QUEUE)
public void(byte [] message) {
   PostEventProto.PostEvent postEvent =
PostEventProto.PostEvent.parseFrom(message);
  
   /*some stupid code to transform to json*?
   sendToPostEventTopic(postEventJSON);
   sendToLogQueue(postEventJSON);
}


Can I use <route> instead of code above ? Do I have transform byte[] to
object and than to JSON or can I transform from protobuf to json ?


--
View this message in context: http://camel.465427.n5.nabble.com/Proper-way-to-process-route-protobuf-protocolbuffers-tp4589761p4589761.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Proper way to process route protobuf/protocolbuffers

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Welcome to the Camel community.

Camel has a protobuf data format which you can use in a Camel route.
Read this link
http://camel.apache.org/protobuf


On Fri, Jul 15, 2011 at 9:48 AM, baklarz <td...@gmail.com> wrote:
> I get protobuf objects from activemq queue. I get messages in byte[] from
> activemq.
> I generate class from *.proto files ?
>
>
> @Consume(uri="activemq:PostEvent.QUEUE)
> public void(byte [] message) {
>   PostEventProto.PostEvent postEvent =
> PostEventProto.PostEvent.parseFrom(message);
>
>   /*some stupid code to transform to json*?
>   sendToPostEventTopic(postEventJSON);
>   sendToLogQueue(postEventJSON);
> }
>
>
> Can I use <route> instead of code above ? Do I have transform byte[] to
> object and than to JSON or can I transform from protobuf to json ?
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Proper-way-to-process-route-protobuf-protocolbuffers-tp4589761p4589761.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/