java - How to avoid null body from entering into next processor in multiple steps -


how can restrict null body entering multiple processor @ 1 common place. in below code instead of putting null body check @ every processor, how can define @ single place ?

<choice>     <when>         <simple>${body} != null</simple>         <process ref="processor1" />         <choice>             <when>                 <simple>${body} != null</simple>                 <process ref="processor2" />                 <!-- splitter -->                 <split>                     <simple>body</simple>                     <process ref="processor3" />                 </split>             </when>            </choice>     </when> </choice>      

i suggest leave root all-together, rendering further null checks obsolete. quick , easy way stop route-processing current message setting exchange.route_stop property on exchange object , return null:

exchange.getproperty(exchange.route_stop, boolean.true) 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -