3
私たちは、以下のラバの流れがあります。Mule:異なるコンポーネントのインターフェイスバインディング、重複を避ける方法は?
<flow name="mule-flow-1">
<component>
<spring-object bean="springBean_1"/>
<binding interface="com.acme.EmailService" method="send">
<vm:outbound-endpoint path="send-email" exchange-pattern="one-way"/>
</binding>
</component>
</flow>
をしかし、今、我々は我々のようにそれを行うことができ、同じEmailService.send
メソッドを使用する新しいのSpring Beanに、新しい流れを紹介したいと思いますので、:
<flow name="mule-flow-2">
<component>
<spring-object bean="springBean_2"/>
<binding interface="com.acme.EmailService" method="send">
<vm:outbound-endpoint path="send-email" exchange-pattern="one-way"/>
</binding>
</component>
</flow>
ご覧のとおり、EmailService.send
メソッドを2つの異なるフローで2回バインドしました。これは純粋なコードの複製です。
EmailService.send
メソッドをどこかに共通の場所にバインドして、mule-flow-1
とmule-flow-2
でrefを使用することはできますか?
を、問題がある:我々は彼らのボットは、そう、 'EmailService'インタフェースと同様の方法' send'を使用している、 'springBean_1'と' springBean_2'を使用していますあなたの解決策は少し間違っています。 – user471011