2
votes

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

2
Are you able to use a CCDT instead of hard coding the details into the configuration? - Morag Hughson
@Morag: I am not hard coding the values in context file. I am reading those values from the properties file - Sunil Dutta
but they are hard coded in the properties file was my point. If you use a CCDT then you can select from as many target queue managers as you want, and flexibly change them when you need to as well. - Morag Hughson
OK, I got your point and I think it is very nice suggestion. Do you have any CCDT example? - Sunil Dutta

2 Answers

1
votes

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

1
votes

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>