camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lone squirrely <>
Subject Using protobufs within Camel
Date Tue, 08 Mar 2011 23:21:28 GMT
Hey, I am aware that there some peculiarity in dealing with protobufs
and camel, I was wondering if you could help me figure out how I can
interface with an already working system?

They define a route that goes like this:

                <!-- send Queries to MARS for report generation,
return response to
                         originator -->
                <route id="Query_Service">
                        <from uri="activemq:db.query" />
                        <unmarshal ref="QueryProtobuf" />
                        <bean ref="dataQueryService" />
                        <marshal ref="QueryRspProtobuf" />

Where they use a work around:

        <bean id="QueryProtobuf"
                <property name="instanceClass"
value="com.project.protobuf.Msgs$Query" />
and a similar way for the QueryRspProtobuf

This all works and they can send messages amongst themselves...
What I need to do is send a message from a difference context (same
proto type), but I don't get a response.

  public QueryRsp requestReport (DataType dt, ReportType rt) {
    Query.Builder queryBuilder = Query.newBuilder ();
    /* .... */
    Query query = ();

    QueryRsp rsp = (QueryRsp) template.sendBody ("activemq:db.query",
ExchangePattern.InOut, query);

    return rsp;

I setup no new routes, just a simple camel context (in Spring).

When I execute this method I get this error on the receiver side:

2011-03-08 15:07:24,116 [enerContainer-1] INFO  Tracer
        - >>> (Query_Service) from(activemq://db.query) -->  <<<
Pattern:InOut, Headers:{JMSTimestamp=1299625644101, JMSPriority=4,
JMSDestination=queue://db.query, JMSRedelivered=false,
JMSDeliveryMode=2, JMSExpiration=1299625664101,
JMSMessageID=ID:<server>-52837-1299625643564-0:2:2:1:1, JMSType=null,

and on the sender side:
15:07:24,067  INFO TemporaryQueueReplyManager:215 - Starting reply
listener container on endpoint: Endpoint[activemq://db.query]
15:07:24,084  INFO JmsProducer:73 - Using JmsReplyManager:
to process replies from temporary queue
15:07:24,091  WARN JmsBinding:471 - Cannot determine specific
JmsMessage type to use from body class. Will use generic JmsMessage.
Body class: com.netrecon.proto.mars.DssMsgs.Query. If you want to send
a POJO then your class might need to implement,
or you can force a specific type by setting the jmsMessageType option
on the JMS endpoint.

I have looked at the example on the camel page: and tried the second client
impl. on tp mp
but that looks like it is to setup another route (like the original
XML).  Should I consider setting up an intermediary queue
(direct:protostart) that will feed the marshalled version along?
Please help! Thanks!!

View raw message