camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Camel-SJMS cannot convert Jetty objects to JMS object
Date Thu, 03 Sep 2015 14:58:44 GMT
Hi

Yeah it should use same algorithm to filter out not supported headers
automatic like camel-jms. You are welcome to log a JIRA ticket.

On Thu, Sep 3, 2015 at 9:09 AM, metatech <metatechbe@gmail.com> wrote:
> Hello,
>
> I tried to use the Camel-SJMS component in Camel 2.14.3 (ServiceMix 5.4.1).
> It works nearly completely with the default configuration, both for
> producers and consumers : this relatively new component seems to be already
> quite mature !
> I had only one problem : when the route is "from" a Jetty endpoint, 2
> headers (CamelHttpServletRequest and CamelHttpServletResponse) cannot be
> serialized by ActiveMQ and this is throwing an IllegalHeaderException.
>
> The workaround is to remove these headers as below :
>
>         <route id="SJMS_Example">
>             <from uri="jetty:http://localhost:8888/asyncRoute"/>
>             <removeHeader headerName="CamelHttpServletRequest"/>
>             <removeHeader headerName="CamelHttpServletResponse"/>
>             <to uri="sjms:queue:myQueue?exchangePattern=InOnly" />
>         </route>
>
> It would be nice if the Camel-SJMS would handle this case, as the Camel-JMS
> component does.
>
> Thanks in advance,
> metatech
>
>
> Caused by: org.apache.camel.component.sjms.jms.IllegalHeaderException:
> Failed to set the header CamelHttpServletRequest header. Cause: Only
> objectified primitive objects, String, Map and List types are allowed but
> was: (GET /asyncRoute)@327121663 org.eclipse.jetty.server.Request@137f7aff
> type: class org.eclipse.jetty.server.Request
>         at
> org.apache.camel.component.sjms.jms.JmsMessageHelper.setJmsMessageHeaders(JmsMessageHelper.java:254)
>         at
> org.apache.camel.component.sjms.jms.JmsMessageHelper.createMessage(JmsMessageHelper.java:146)
>         at
> org.apache.camel.component.sjms.producer.InOnlyProducer.sendMessage(InOnlyProducer.java:113)
>         ... 57 more
> Caused by: javax.jms.MessageFormatException: Only objectified primitive
> objects, String, Map and List types are allowed but was: (GET
> /asyncRoute)@327121663 org.eclipse.jetty.server.Request@137f7aff type: class
> org.eclipse.jetty.server.Request
>         at
> org.apache.activemq.command.ActiveMQMessage.checkValidObject(ActiveMQMessage.java:538)
>         at
> org.apache.activemq.command.ActiveMQMessage.setObjectProperty(ActiveMQMessage.java:504)
>         at
> org.apache.activemq.command.ActiveMQMessage.setObjectProperty(ActiveMQMessage.java:488)
>         at
> org.apache.camel.component.sjms.jms.JmsMessageHelper.setProperty(JmsMessageHelper.java:370)
>         at
> org.apache.camel.component.sjms.jms.JmsMessageHelper.setJmsMessageHeaders(JmsMessageHelper.java:252)
>         ... 59 more
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-SJMS-cannot-convert-Jetty-objects-to-JMS-object-tp5771193.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition: http://www.manning.com/ibsen2

Mime
View raw message