Author |
Message
|
RollingJ |
Posted: Wed Oct 03, 2007 1:30 am Post subject: Integer encoding issues with trigger message |
|
|
Newbie
Joined: 03 Oct 2007 Posts: 5
|
My configuration is MQ client running on AIX targetting a server on an x86 Linux machine.
When my trigger monitor receives the TM it needs to check MQTM.ApplType to determine what action to take.
The field is in reversed integer encoding as confirmed by MQMD.Encoding - this is expected.
I could reverse the byte ordering of ApplType myself either in the trigger monitor or via a user exit.
My question is: Since the TM is an MQ defined structure, is there a way of getting the conversion done automatically? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Oct 03, 2007 1:33 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
So what you're saying is the value of MQTM_ApplType doesn't match any of the MQAT values on the target platform?
Or are you using values in the range MQAT_USER_FIRST to MQAT_USER_LAST? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
RollingJ |
Posted: Wed Oct 03, 2007 1:41 am Post subject: Integer encoding issues with trigger message |
|
|
Newbie
Joined: 03 Oct 2007 Posts: 5
|
That's correct. For example if on the Linux side ApplType is assigned MQAT_CICS (1) on the AIX side the value is 16777216 - so no match. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Oct 03, 2007 1:56 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Ok, you've stumped me!
Where I've tried it across 2 platforms the literals matched up (i.e. I could set MQAT_UNIX or MQAT_WINDOWS_NT on one side & test for the literals on the other).
Maybe I just got lucky that the encoding was the same......  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
RollingJ |
Posted: Wed Oct 03, 2007 2:22 am Post subject: |
|
|
Newbie
Joined: 03 Oct 2007 Posts: 5
|
There's a table which I found in an IBM paper on the subject which shows the list of platforms on which MQ runs and their associated endianism. Any time you've got to communicate between big and little endian this problem is going to come up.
The document can be found at http://www-1.ibm.com/support/docview.wss?uid=swg27005729 |
|
Back to top |
|
 |
Vitor |
Posted: Wed Oct 03, 2007 2:26 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
I suppose the simple answer is to not run the client trigger monitor & have it all natively on the server. It's the most common configuration and gets round this problem.
Doesn't help with triggering client programs through!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
RollingJ |
Posted: Wed Oct 03, 2007 2:35 am Post subject: |
|
|
Newbie
Joined: 03 Oct 2007 Posts: 5
|
Ah well, I was just trying to avoid extra work.
Thanks for giving it some thought.
Cheers, Peter. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Oct 03, 2007 3:43 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Did you issue the GET with convert when you GOT the trigger message?
...
What value do you hope to get from writing your own trigger monitor, rather than using runmqtmc on the AIX platform? enhanced security? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
RollingJ |
Posted: Wed Oct 03, 2007 4:38 am Post subject: |
|
|
Newbie
Joined: 03 Oct 2007 Posts: 5
|
You're a star! That's precisely what I was looking for.
I had tried convert but hadn't dug deep enough into the details of MQMD.Format.
As someone said somewhere else in these forums, read the docs, then read them again, then read them a bit more.
Thanks again.
BTW the reason that we have our own monitor is that one of the things our product (Micro Focus Enterprise Server) does is emulate CICS. So we monitor the queue as per CKTI and internally dispatch the corresponding transaction for a CICS ApplType request. |
|
Back to top |
|
 |
|