I am trying to split a '@' separated string and process every token through same route.
camel-context.xml:
<split streaming="true">
<tokenize token="@"/>
<to uri="validateResubmitTransactionIdProcessor"/>
</split>
Following is processor code snippet:
epublic class ValidateResubmitTransactionIdProcessor implements Processor {
public void process(Exchange exchng) throws Exception {
Object[] args = exchng.getIn().getBody(Object[].class);
}}
I get following exception:
eCaused by: org.apache.camel.InvalidPayloadException: No body available of type: org.apache.camel.Exchange but has value: 11484 of type: java.lang.String on: Message: 11484. Caused by: No type converter available to convert from type: java.lang.String to the required type: org.apache.camel.Exchange with value 11484. Exchange[Message: 11484]. Caused by: [org.apache.camel.NoTypeConversionAvailableException - No type converter available to convert from type: java.lang.String to the required type: org.apache.camel.Exchange with value 11484] at org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:101) at org.apache.camel.builder.ExpressionBuilder$35.evaluate(ExpressionBuilder.java:847) Caused by: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: java.lang.String to the required type: org.apache.camel.Exchange with value 11484 at org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:169) at org.apache.camel.core.osgi.OsgiTypeConverter.mandatoryConvertTo(OsgiTypeConverter.java:110) at org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:99)nter
I am not sure if I am using splitter the right way. Also, do know how can I convert java.lang.String to Exchange. This doesn't seems to be supported by camel.