title: Apache Camel inOut routes, out exchange marshaling/unmarshaling with jaxb
body: <p>we have this apache camel route,</p>
  <pre><code>from(commandDrop).marshal(jaxbDataFormat).to(jmsQueue);    
  from(jmsQueue).inOut(&quot;jms:doCommand?requestTimeout=500000&quot;);          
  from(&quot;jms:doCommand&quot;).unmarshal(jaxbDataFormat).beanRef(&quot;bean&quot;);
  </code></pre>
  <p>.... and a bean class like this</p>
  <pre><code>class BeanClass {
          public void doCommand(Command command, Exchange exchange){
      {       
          command.run();      
          exchange.getOut().setBody(command);     
      }
  }
  </code></pre>
  <p>we are trying to put a message and wait for a reply on the route like this</p>
  <pre><code>Object ret = template.requestBody(commandDrop, new TestCommand());
  </code></pre>
  <p>Objects on the route in the forward direction are getting marshaled/unmarshaled splendidly. But the setBody call is causing a java.io.NotSerializableException. Is there a way to configure the route to use the same jaxb marshaling/unmarshaling on the way back? My Command class contain some jaxb- generated class objects that are not serializable. They are handled well by the marshal/unmarshal in the forward direction and would be great if they can be on the way back. Am relatively new to camel so not sure if this is the best way to go about this.</p>
  <p>thanks a bunch.</p>