Author |
Message
|
eniomarques |
Posted: Thu Jun 01, 2017 11:12 am Post subject: IBM MQ integration with Apache ActiveMQ |
|
|
Novice
Joined: 25 May 2015 Posts: 24 Location: Brazil
|
Hello guys!
We are currently testing the ActiveMQ (v5.14.4) integration with IBM MQ (v9.0) and everything is working as expected, except when it comes to the cluster queues.
We have a cluster with 3 QMs, with a local queue shared in the cluster from all 3 locations (with defbind as notfixed).
When we send the messages from ActiveMQ, all the messages end up in the QM we are connecting to, and if we delete the queue in that QM, then they start to be balanced across the other 2 by the first QM.
Does any of you have a similar setup? Is there any workaround except using a QM as a "hub" for AMQ?
Thanks! |
|
Back to top |
|
 |
tczielke |
Posted: Thu Jun 01, 2017 12:33 pm Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
I am not sure what all your requirements are, but look into using CLWLUSEQ(ANY) for you local clustered queues. It might give what you are looking for. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
eniomarques |
Posted: Thu Jun 01, 2017 2:41 pm Post subject: |
|
|
Novice
Joined: 25 May 2015 Posts: 24 Location: Brazil
|
tczielke wrote: |
I am not sure what all your requirements are, but look into using CLWLUSEQ(ANY) for you local clustered queues. It might give what you are looking for. |
Thanks for the reply, but that doesn't work. Changed all 3 local queues in each QM to CLWLUSEQ(ANY) , but they are still going all to the same.
Sent 4 messages after the change, and they all ended in the same queue.
AMQ8450: Display queue status details.
QUEUE(SAMEQ.QL) TYPE(QUEUE)
CURDEPTH(4) IPPROCS(0)
LGETDATE( ) LGETTIME( )
LPUTDATE(2017-06-01) LPUTTIME(18.27.50)
MEDIALOG( ) MONQ(LOW)
MSGAGE(40) OPPROCS(0)
QTIME( , ) UNCOM(NO)
dis q(SAMEQ)
3 : dis qa(SAMEQ)
AMQ8409: Display Queue details.
QUEUE(SAMEQ) TYPE(QALIAS)
ALTDATE(2017-06-01) ALTTIME(18.25.35)
TARGET(SAMEQ.QL) CLUSNL( )
CLUSTER(TESTCLUSTER) CLWLPRTY(0)
CLWLRANK(0) CUSTOM( )
DEFBIND(NOTFIXED) DEFPRTY(0)
DEFPSIST(NO) DEFPRESP(SYNC)
DEFREADA(NO) DESCR( )
GET(ENABLED) PUT(ENABLED)
PROPCTL(COMPAT) SCOPE(QMGR)
TARGTYPE(QUEUE)
dis ql(SAMEQ.QL)
4 : dis q(SAMEQ.QL)
AMQ8409: Display Queue details.
QUEUE(SAMEQ.QL) TYPE(QLOCAL)
ACCTQ(QMGR) ALTDATE(2017-06-01)
ALTTIME(18.26.37) BOQNAME( )
BOTHRESH(0) CLUSNL( )
CLUSTER( ) CLCHNAME( )
CLWLPRTY(0) CLWLRANK(0)
CLWLUSEQ(ANY) CRDATE(2017-06-01)
CRTIME(18.25.09) CURDEPTH(4)
CUSTOM( ) DEFBIND(NOTFIXED)
DEFPRTY(0) DEFPSIST(NO)
DEFPRESP(SYNC) DEFREADA(NO)
DEFSOPT(SHARED) DEFTYPE(PREDEFINED)
DESCR( ) DISTL(NO)
GET(ENABLED) HARDENBO
INITQ( ) IPPROCS(0)
MAXDEPTH(5000) MAXMSGL(4194304)
MONQ(LOW) MSGDLVSQ(PRIORITY)
NOTRIGGER NPMCLASS(NORMAL)
OPPROCS(0) PROCESS( )
PUT(ENABLED) PROPCTL(COMPAT)
QDEPTHHI(80) QDEPTHLO(20)
QDPHIEV(DISABLED) QDPLOEV(DISABLED)
QDPMAXEV(ENABLED) QSVCIEV(NONE)
QSVCINT(999999999) RETINTVL(999999999)
SCOPE(QMGR) SHARE
STATQ(QMGR) TRIGDATA( )
TRIGDPTH(1) TRIGMPRI(0)
TRIGTYPE(FIRST) USAGE(NORMAL)
If I delete this queue from this 01QM, the messages are routed to 02QM and 03QM normally and balanced. |
|
Back to top |
|
 |
tczielke |
Posted: Thu Jun 01, 2017 3:21 pm Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
You will probably need to lose the QALIAS definition, if you want this to work. The QALIAS does not have a CLWLUSEQ attribute. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
eniomarques |
Posted: Thu Jun 01, 2017 3:34 pm Post subject: |
|
|
Novice
Joined: 25 May 2015 Posts: 24 Location: Brazil
|
tczielke wrote: |
You will probably need to lose the QALIAS definition, if you want this to work. The QALIAS does not have a CLWLUSEQ attribute. |
Makes sense, it worked, thank you!
The problem is that all of our current MQ setup is using aliases, but at least we managed to get the clustering working fine. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Jun 01, 2017 4:03 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Seems wrong to me that the use of an Alias Q breaks CLWLUSEQ(ANY). But apparently so.
Edit: It can work as desired. See further posts below. _________________ Peter Potkay
Keep Calm and MQ On
Last edited by PeterPotkay on Sat Jun 03, 2017 7:50 am; edited 1 time in total |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jun 02, 2017 4:16 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
PeterPotkay wrote: |
Seems wrong to me that the use of an Alias Q breaks CLWLUSEQ(ANY). But apparently so. |
What happens if you replace the alias with a queue remote with a blank qmgr name? or a cluster alias as qmgr name...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
eniomarques |
Posted: Fri Jun 02, 2017 6:32 am Post subject: |
|
|
Novice
Joined: 25 May 2015 Posts: 24 Location: Brazil
|
fjb_saper wrote: |
PeterPotkay wrote: |
Seems wrong to me that the use of an Alias Q breaks CLWLUSEQ(ANY). But apparently so. |
What happens if you replace the alias with a queue remote with a blank qmgr name? or a cluster alias as qmgr name...  |
That should work, but as our whole MQ env is already set with aliases, I guess the necessary effort is not worth it. After some discussion, we will probably create a 'hub' QM part of the cluster, to focus the AMQ connections. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Jun 02, 2017 8:39 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
I just tested at MQ 8.0.0.6, and my messages load balanced thru the Alias queue to the 2 clustered queues, one of which was on the same QM as the Alias queue.
I made a client connection to QM1, and put 100 messages to PETER.CLUSTER.TEST. 50 went to QM2, 50 stayed on QM1.
Then I made a client connection to QM1, and put 100 messages to PETER.CLUSTER.TEST.AQ (the Alias Q). Same results - 50 went to QM2, 50 stayed on QM1.
QM1
Code: |
DEFINE QLOCAL('PETER.CLUSTER.TEST') +
CLUSTER('MYCLUSTER') +
CLWLRANK(0) +
CLWLPRTY(0) +
CLWLUSEQ(ANY) +
USAGE(NORMAL) +
SCOPE(QMGR) +
MAXDEPTH(100) +
MAXMSGL(4194304) +
DEFPRTY(0) +
DEFPSIST(NO) +
DEFPRESP(SYNC) +
DEFREADA(NO) +
NPMCLASS(NORMAL) +
DEFBIND(NOTFIXED) +
MSGDLVSQ(PRIORITY) +
PUT(ENABLED) +
GET(ENABLED) +
HARDENBO +
BOTHRESH(0) +
SHARE +
DEFSOPT(SHARED) +
RETINTVL(999999999) +
DISTL(NO) +
PROPCTL(COMPAT) +
NOTRIGGER +
TRIGTYPE(FIRST) +
TRIGMPRI(0) +
TRIGDPTH(1) +
QDEPTHHI(80) +
QDEPTHLO(20) +
QDPMAXEV(ENABLED) +
QDPHIEV(DISABLED) +
QDPLOEV(DISABLED) +
QSVCINT(999999444) +
QSVCIEV(NONE) +
STATQ(QMGR) +
ACCTQ(QMGR) +
MONQ(QMGR) +
REPLACE
DEFINE QALIAS('PETER.CLUSTER.TEST.AQ') +
TARGTYPE(QUEUE) +
CLWLRANK(0) +
CLWLPRTY(0) +
TARGET('PETER.CLUSTER.TEST') +
SCOPE(QMGR) +
DEFPRTY(0) +
DEFPSIST(NO) +
DEFPRESP(SYNC) +
DEFREADA(NO) +
DEFBIND(NOTFIXED) +
PUT(ENABLED) +
GET(ENABLED) +
PROPCTL(COMPAT) +
REPLACE
|
QM2
Code: |
DEFINE QLOCAL('PETER.CLUSTER.TEST') +
CLUSTER('MYCLUSTER') +
CLWLRANK(0) +
CLWLPRTY(0) +
CLWLUSEQ(ANY) +
USAGE(NORMAL) +
SCOPE(QMGR) +
MAXDEPTH(100) +
MAXMSGL(4194304) +
DEFPRTY(0) +
DEFPSIST(NO) +
DEFPRESP(SYNC) +
DEFREADA(NO) +
NPMCLASS(NORMAL) +
DEFBIND(NOTFIXED) +
MSGDLVSQ(PRIORITY) +
PUT(ENABLED) +
GET(ENABLED) +
HARDENBO +
BOTHRESH(0) +
SHARE +
DEFSOPT(SHARED) +
RETINTVL(999999999) +
DISTL(NO) +
PROPCTL(COMPAT) +
NOTRIGGER +
TRIGTYPE(FIRST) +
TRIGMPRI(0) +
TRIGDPTH(1) +
QDEPTHHI(80) +
QDEPTHLO(20) +
QDPMAXEV(ENABLED) +
QDPHIEV(DISABLED) +
QDPLOEV(DISABLED) +
QSVCINT(999999999) +
QSVCIEV(NONE) +
ACCTQ(QMGR) +
MONQ(QMGR) +
REPLACE |
_________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
eniomarques |
Posted: Fri Jun 02, 2017 8:56 am Post subject: |
|
|
Novice
Joined: 25 May 2015 Posts: 24 Location: Brazil
|
PeterPotkay wrote: |
I just tested at MQ 8.0.0.6, and my messages load balanced thru the Alias queue to the 2 clustered queues, one of which was on the same QM as the Alias queue.
I made a client connection to QM1, and put 100 messages to PETER.CLUSTER.TEST. 50 went to QM2, 50 stayed on QM1.
Then I made a client connection to QM1, and put 100 messages to PETER.CLUSTER.TEST.AQ (the Alias Q). Same results - 50 went to QM2, 50 stayed on QM1.
QM1
Code: |
DEFINE QLOCAL('PETER.CLUSTER.TEST') +
CLUSTER('MYCLUSTER') +
CLWLRANK(0) +
CLWLPRTY(0) +
CLWLUSEQ(ANY) +
USAGE(NORMAL) +
SCOPE(QMGR) +
MAXDEPTH(100) +
MAXMSGL(4194304) +
DEFPRTY(0) +
DEFPSIST(NO) +
DEFPRESP(SYNC) +
DEFREADA(NO) +
NPMCLASS(NORMAL) +
DEFBIND(NOTFIXED) +
MSGDLVSQ(PRIORITY) +
PUT(ENABLED) +
GET(ENABLED) +
HARDENBO +
BOTHRESH(0) +
SHARE +
DEFSOPT(SHARED) +
RETINTVL(999999999) +
DISTL(NO) +
PROPCTL(COMPAT) +
NOTRIGGER +
TRIGTYPE(FIRST) +
TRIGMPRI(0) +
TRIGDPTH(1) +
QDEPTHHI(80) +
QDEPTHLO(20) +
QDPMAXEV(ENABLED) +
QDPHIEV(DISABLED) +
QDPLOEV(DISABLED) +
QSVCINT(999999444) +
QSVCIEV(NONE) +
STATQ(QMGR) +
ACCTQ(QMGR) +
MONQ(QMGR) +
REPLACE
DEFINE QALIAS('PETER.CLUSTER.TEST.AQ') +
TARGTYPE(QUEUE) +
CLWLRANK(0) +
CLWLPRTY(0) +
TARGET('PETER.CLUSTER.TEST') +
SCOPE(QMGR) +
DEFPRTY(0) +
DEFPSIST(NO) +
DEFPRESP(SYNC) +
DEFREADA(NO) +
DEFBIND(NOTFIXED) +
PUT(ENABLED) +
GET(ENABLED) +
PROPCTL(COMPAT) +
REPLACE
|
QM2
Code: |
DEFINE QLOCAL('PETER.CLUSTER.TEST') +
CLUSTER('MYCLUSTER') +
CLWLRANK(0) +
CLWLPRTY(0) +
CLWLUSEQ(ANY) +
USAGE(NORMAL) +
SCOPE(QMGR) +
MAXDEPTH(100) +
MAXMSGL(4194304) +
DEFPRTY(0) +
DEFPSIST(NO) +
DEFPRESP(SYNC) +
DEFREADA(NO) +
NPMCLASS(NORMAL) +
DEFBIND(NOTFIXED) +
MSGDLVSQ(PRIORITY) +
PUT(ENABLED) +
GET(ENABLED) +
HARDENBO +
BOTHRESH(0) +
SHARE +
DEFSOPT(SHARED) +
RETINTVL(999999999) +
DISTL(NO) +
PROPCTL(COMPAT) +
NOTRIGGER +
TRIGTYPE(FIRST) +
TRIGMPRI(0) +
TRIGDPTH(1) +
QDEPTHHI(80) +
QDEPTHLO(20) +
QDPMAXEV(ENABLED) +
QDPHIEV(DISABLED) +
QDPLOEV(DISABLED) +
QSVCINT(999999999) +
QSVCIEV(NONE) +
ACCTQ(QMGR) +
MONQ(QMGR) +
REPLACE |
|
How did you send the messages? I guess the problem is in the way the AMQ binds the queue. I'm sending the messages thru the queue in the AMQ side. In a regular client connection I guess the defbind as notfixed is enough to do the balancing.
This is what I have in AMQ:
Code: |
<jmsBridgeConnectors>
<jmsQueueConnector name="OpenJMSBridge-Outbound" outboundQueueConnectionFactory="#mqConnectionFactory">
<outboundQueueBridges>
<outboundQueueBridge outboundQueueName="SAMEQ" localQueueName="SAMEQ.CLUSTERED"/>
</outboundQueueBridges>
</jmsQueueConnector>
</jmsBridgeConnectors>
|
And this is the QCF:
Code: |
<bean id="mqConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
<property name="transportType" value="1"/>
<property name="queueManager" value="MYQM" />
<property name="hostName" value="myserver.com" />
<property name="channel" value="AMQ.CLIENT" />
<property name="port" value="1414" />
</bean> |
|
|
Back to top |
|
 |
PeterPotkay |
Posted: Sat Jun 03, 2017 7:49 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
I used the MO71 API Exerciser as well as MQ's sample program amqsputc.
Make sure your program is not opening the queue for both output (puts) as well as input (gets), even though you only intend to put. Since you can only get from a local instance of a queue, if you use the input option on the open call, you are going to get "stuck" to the local instance and load balancing will not occur.
Also make sure you are not specifying the destination queue manager name (as the local queue manager) on the open of the queue object. Again, that will force all activities on that handle to resolve to the local instance of the queue. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
tczielke |
Posted: Sat Jun 03, 2017 9:04 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
I think I know what is going on here. When you open a qalias, the CLWLUSEQ that is used is what is defined on the QMGR. My guess then is that eniomarques has a DIS QMGR CLWLUSEQ(LOCAL) and Peter has a DIS QMGR CLWLUSEQ(ANY). Regardless, if eniomarques is ok with doing an ALTER QMGR CLWLUSEQ(ANY), then the qalias can remain intact and you can have the desired behavior without the need for a hub queue manager. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Sat Jun 03, 2017 1:19 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
tczielke wrote: |
I think I know what is going on here. When you open a qalias, the CLWLUSEQ that is used is what is defined on the QMGR. My guess then is that eniomarques has a DIS QMGR CLWLUSEQ(LOCAL) and Peter has a DIS QMGR CLWLUSEQ(ANY). Regardless, if eniomarques is ok with doing an ALTER QMGR CLWLUSEQ(ANY), then the qalias can remain intact and you can have the desired behavior without the need for a hub queue manager. |
Tim,
Up above he shows his q def and he does have CLWLUSEQ(ANY) on his q definition, like I do. The q setting trumps any setting the QM may have for CLWLUSEQ. My queue manager does have CLWLUSEQ(LOCAL) for what its worth, for purposes of backwards compatibility for all queues unless we specifically want CLWLUSEQ(ANY) behavior for a queue. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
tczielke |
Posted: Sat Jun 03, 2017 2:44 pm Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
I did test this out with amqsput and confirmed this behavior. When you open a queue that resolves to a qalias queue, MQ will use the attributes of the qalias definition. Since there is no CWLWUSEQ attribute for a qalias definition, MQ defaults to using the CLWLUSEQ attribute of the queue manager. I am not sure why you are seeing your behavior, but I did test that what I stated before should work for eniomarques. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
eniomarques |
Posted: Sat Jun 03, 2017 7:19 pm Post subject: |
|
|
Novice
Joined: 25 May 2015 Posts: 24 Location: Brazil
|
I'll confirm that Monday morning, thanks a lot for the inputs so far  |
|
Back to top |
|
 |
|