This is the consumer which the messages is sent to:
<jms:consumer service="fork:terrorReceiver"
endpoint="jmsEndpoint"
targetService="fork:terrorDSLRouter"
destinationName="terror.in"
connectionFactory="#connectionFactory"
marshaler="#TerrorJMSMarshaler"/>
The "TerrorJMSMarshaler" is:
public class TerrorJMSMarshaler extends DefaultConsumerMarshaler {
protected void populateMessage(Message message, NormalizedMessage
normalizedMessage) throws Exception {
if (message instanceof ObjectMessage) {
ObjectMessage objectMessage = (ObjectMessage) message;
Object payload = objectMessage.getObject();
Source source = JiBXUtil.marshalDocument(payload, "UTF-8");
if(payload instanceof TerrorResponse) {
TerrorResponse terrorResponse = (TerrorResponse)
payload;
normalizedMessage.setProperty("org.apache.servicemix.eip.splitter.corrid",
terrorResponse.getRequestID());
normalizedMessage.setProperty("org.apache.servicemix.eip.splitter.index",
new Integer(1));
normalizedMessage.setProperty("org.apache.servicemix.eip.splitter.count",
new Integer(2));
}
normalizedMessage.setContent(source);
} else {
throw new UnsupportedOperationException("JMS message is not a
ObjectMessage");
}
}
}
The message is NOT of type TerrorResponse, so it should not jump into the
statement. But from here the JiBXUtil (where the exception is thrown) is
used. Still I can't see where the error is.
--
View this message in context:
http://old.nabble.com/Help-to-understand-xpath-expression-in-camel-routebuilder-tp26779963p26815131.html
Sent from the Camel - Users mailing list archive at Nabble.com.