これを行う方法は設計上の決定です。 個々の部分をサブルートとして使用することができます(これが私の好ましい方法です)。
ルートをより機能的に構造化し、少なくともより読みやすくします。 その後、multicast
コンポーネントを使用してメッセージ(ファイル)を次々に、または並行して渡すことができます。
<route id="main-route">
<from uri="..." />
<!-- DB processing -->
<to uri="direct:db-route-endpoint"/>
<multicast parallelProcessing="false">
<!-- No parallel processing: file will be stored after Web Service call completed
or for parallel parallelProcessing="true" -->"
<to uri="...web service endpoint... "/>
<to uri="direct:store-file-endpoint"/>
</multicast>
</route>
<route id="db-route">
<from uri="direct:db-route-endpoint" />
... DB processing ...
</route>
<route id="store-file-route">
<from uri="direct:store-file-endpoint" />
... save file to another directory ...
</route>
:
XMLのDSLで、それは次のようになります