異なるキャメルルートでブループリントDSLによって定義された変換ステップを再利用したいが、これを達成する方法が見つからなかった。キャメルDSL - Blueprint DSL経由で異なるルートで定義された再利用変換ロジック
のは、ここでの例を挙げてみましょう:
<camelContext id="jms-context" xmlns="http://camel.apache.org/schema/blueprint">
<route id="inputAqTest8">
<from id="_fromAqTest8" uri="aqTest8:queue:QUELOGENTRY"/>
<!-- some complicated transformation here -->
<to id="_to1" uri="umChannel:topic:Input"/>
</route>
<route id="inputAqTest12">
<from id="_fromAqTest12" uri="aqTest12:queue:QUEPOSTDATA"/>
<!-- some complicated transformation here -->
<to id="_to2" uri="umChannel:topic:Input"/>
</route>
</camelContext>
私はすでに変換し、直接コンポーネントによって接続された独自のルートへの配信を動かすことによって、これを最適化。
<camelContext id="jms-context" xmlns="http://camel.apache.org/schema/blueprint">
<route id="inputAqTest8">
<from id="_fromAqTest8" uri="aqTest8:queue:QUELOGENTRY"/>
<to id="_to1" uri="direct:process"/>
</route>
<route id="inputAqTest12">
<from id="_fromAqTest12" uri="aqTest12:queue:QUEPOSTDATA"/>
<to id="_to2" uri="direct:process"/>
</route>
<route id="process">
<from id="_from1" uri="direct:process"/>
<!-- some complicated transformation here -->
<to id="_to" uri="umChannel:topic:Input"/>
</route>
</camelContext>
これは変換ロジックを完全に再利用します。しかし、直接的に「通話」を同期させるので、経路はもはや独立していません。また、変換されたメッセージが並行して配信されないため、プロデューサが1つだけ減速するようになりました(これがすべてを1つのルートに統合したくない理由です)。
どのようにして、両方のアプローチのベストを得ることができますか?変換の定義を再利用し、ルートを独立した状態に保ちますか?あなたのアイデアを事前に感謝します。