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.

Reply via email to