複数の構成ファイルを持つ Spring Integration アプリケーションがあり、各構成ファイルは JMS キューに接続されています。すべてのキューが単一のチャネル [requestChannel] にメッセージを送信します。この共通情報を common.xml ファイルに保持しています。
メッセージを JMS キューに送信すると、1 つのキューのみがメッセージ requestChannel を送信し、残りのキューはメッセージを宛先 [requestChannel] に送信しません。
誰かが私が間違っていることを提案できますか?
2 つの異なるファイルで同じ変数名を使用し、それらを 1 つのメイン Conext ファイルで呼び出すことはできますか? [MainApplicationContext.xml]、現在、これを行っています。
MainApplicationContext.xml ファイル -- 他のすべての構成ファイルを呼び出します。
<beans>
<import resource="common.xml"/>
<import resource="config1.xml"/>
<import resource="config2.xml"/>
<import resource="config3.xml"/>
</beans>
Common.xml -- 共通のチャネルの詳細があります
<bean>
<int:channel id="requestChannel" />
<bean id="testBean" class="com.TestBean" />
<int:chain input-channel="requestChannel">
<int:service-activator ref="testBean" method="processor"/>
</int:chain>
<int:channel id="errorChannel" />
<bean id="epBean" class="com.ErrorProcessorBean" />
<int:chain input-channel="errorChannel">
<int:service-activator ref="epBean" method="processor"/>
</int:chain>
</bean>
config1.xml -- JMS キュー 1
<beans>
<int-jms:message-driven-channel-adapter
id="jmsInputQueueAdaptor_au" channel="requestChannel" connection-factory="cf_au" destination="InputQueueOne"
error-channel="errorChannel" />
<jee:jndi-lookup id="cf_au" jndi-name="jms/ConnectionFactory">
</jee:jndi-lookup>
<jee:jndi-lookup id="InputQueueOne" jndi-name="jms/InputQueueOne">
</jee:jndi-lookup>
</beans>
config2.xml -- JMS キュー 2
<beans>
<int-jms:message-driven-channel-adapter
id="jmsInputQueueAdaptor_au" channel="requestChannel" connection-factory="cf_au" destination="InputQueueOne"
error-channel="errorChannel" />
<jee:jndi-lookup id="cf_au" jndi-name="jms/ConnectionFactory">
</jee:jndi-lookup>
<jee:jndi-lookup id="InputQueueTwo" jndi-name="jms/InputQueueTwo">
</jee:jndi-lookup>
</beans>