问题
I am using spring integration to connect with the IBM MQ. My spring integration application is connecting successfully with IBM MQ. Now the MQ team made the MQ manager as the clustered manager i.e. queue manager is containing 2 host one active and one passive because if one host is down the passive one will up and running. Below is my spring integration configuration for MQ and I can pass only one host.
<bean id="mqQueueConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
<property name="hostName" value=""/>
<property name="port" value=""/>
<property name="channel" value=""/>
<property name="queueManager" value=""/>
<property name="transportType" value="1"/>
</bean>
Is there any way by which we can pass both the active and passive host's from the configuration. I tried with the comma in host but that is not supported .
Please suggest
回答1:
You should specify the hosts under the property connectionNameList, don't use hostName and port.
http://www-01.ibm.com/support/docview.wss?uid=swg21397867
Multi Instance MQ set up
回答2:
The ConnectionNameList will allow to pass the active and passive host
<bean id="mqQueueConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
<property name="connectionNameList" value="activeHost(port),passiveHost(port)"/>
<property name="channel" value="channel Name"/>
<property name="queueManager" value="Queue Manager name"/>
<property name="transportType" value="transport type"/>
</bean>
来源:https://stackoverflow.com/questions/36314524/spring-integration-support-for-clustered-high-availability-ibm-mq-manager