Camel Processor not working in a Splitter pattern -


i have camel route which, when bit simplified, boils down following one:

<bean id="myprocessor" class="com.acme.myprocessor" /> <camelcontext xmlns="http://camel.apache.org/schema/spring">      <route>         <from             uri="file:/home/inbox?filename=file.txt&amp;noop=true" />         <split>             <tokenize token="@" />             <process ref="myprocessor" />         </split>          <to             uri="file:/home/outbox" />     </route> </camelcontext> 

to surprise have found if processor being invoked, not able change single tokens. example:

public class myprocessor implements processor {      public void process(exchange exchange) throws exception {          string mystring = exchange.getin().getbody(string.class);         exchange.getin().setbody(mystring.touppercase());      }  } 

in end, file produced tokens not altered processor. why ?

try modify route this:

<route>     <from         uri="file:/home/inbox?filename=file.txt&amp;noop=true" />     <split>         <tokenize token="@" />         <process ref="myprocessor" />         <to uri="file:/home/outbox?fileexist=append" />     </split> </route> 

imho, split file, processed processor , don't have results.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -