Yes, use the camel-jaxb dataformat to marshal your payload into a byte[]/String before sending it to the queue. After dequeuing it, unmarshal it to your Java pojo.
Best, Christian ----------------- Software Integration Specialist Apache Camel committer: https://camel.apache.org/team V.P. Apache Camel: https://www.apache.org/foundation/ Apache Member: https://www.apache.org/foundation/members.html https://www.linkedin.com/pub/christian-mueller/11/551/642 On Wed, Sep 11, 2013 at 2:27 PM, contactreji <contactr...@gmail.com> wrote: > Hi Guys > > I have a problem in the following route. > > *<route id="Route1_MES_Queue"> > <from uri="cxf:bean:PowerConsumptionEndpoint"/> > <log message="Persisting Message to queue > ${body}\n"> > <description><bean > ref="myBean"/></description> > </log> > <to uri="activemq:queue:EC_InboundQueue" /> > </route> > * > > The data from cxf:bean:PowerConsumptionEndpoint is not able to queue up in > the message broker. It gives io.serialization exception. > > I tried modifying as cxf:bean:PowerConsumptionEndpoint?dataFormat=MESSAGE > which indeed solved the issue. > > But I have another route picking the same data from the queue as > > * > <route id="Route2_Queue_SAPPI"> > <from uri="activemq:queue:EC_InboundQueue" /> > > <log message="Message dequed Queue ${body}\n"> > <description><bean > ref="myBean"/></description> > </log> > <to uri="SAPClientInvoker" /> > </route>* > > Here the SAPClientInvoker is a Java class which makes a webservice call to > SAP PI system. We have followed the WSDL approach and we have a schema > class > DTPowerConsumption whose object is used to invoke Webservice call to SAP > PI. > * > This is part of SAPClientInvoker Class > DTPowerConsumption PC=exchng.getIn().getBody(DTPowerConsumption.class); > LOGGER.info("\n Data received for Energy Consumption from > MES \n"); > LOGGER.info("\n Sending Request from MES to PI for Energy > Consumption > \n"); > > try { > LOGGER.info("before invoking"); > sapService.siID59PowerconsumptionAsyncOut(PC); > LOGGER.info("Response from PI for Energy > Consumption"); > exchng.getOut().setBody("Response from PI Energy > for consumption"); > > * > Now i assume that dataFormat=MESSAGE parameter is fiddling with the > original > compatible data coming to fuse endpoint and hencethe SAPClientInvoker > webservice call is not able to maintain the perfect call to SAP PI. and SAP > PI ends up sending HTTP 500 error code . > > > Can anyone suggest me how to store the data on route 1 without really > fiddling with the message formats without serialization exceptions? > > Or can I use a marshaller before storing it into the Queue and unmarshaller > after fetching it from the queue before calling SAPClinetInvoker? > > If so can I use Camel component > > *<marshal> > <jaxb prettyPrint="false" > contextPath="org.apache.camel.example" > partClass="org.apache.camel.example.PurchaseOrder" > fragment="true" > partNamespace="{http://example.camel.org/apache}po" /> > </marshal> > > <unmarshal> > <jaxb prettyPrint="false" > contextPath="org.apache.camel.example" > partClass="org.apache.camel.example.Partial" /> > </unmarshal> > * > What is the value to be entered for contextPath and partNamespace?? I am > confused with that. > If there is a alternate way to handle this, please help me with it.. > > Reji > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/CFX-to-Queue-io-serializationException-tp5739142.html > Sent from the Camel - Users mailing list archive at Nabble.com. >