Author |
Message
|
kolthorr |
Posted: Sun Mar 10, 2002 8:14 pm Post subject: |
|
|
Apprentice
Joined: 09 Mar 2002 Posts: 31
|
Hi all,
I'm trying to run a program that uses PCFs to enquire about channel status from an NT Client (MQ v5.2.1) to various queue managers. It works fine when talking to NT (MQ v5.0) servers, but barfs badly when run against unix servers (MQ v5.2). (The number '33554432' often features prominently amoung MsgType, parameter count, etc - meaningless numbers; and a seemingly random number of replies will come back, regardless of the number of channels actually in use).
If I compile the code on the unix boxes and run it 'locally' on the unix box, it works fine, so I think the PCF command is correct.
I can't find anything on the web suggesting this _shouldn't_ work. Are there known problems doing this across platforms and MQ versions?
Thanks very much for any thoughts.
Regards,
Andrew Wright |
|
Back to top |
|
 |
kolban |
Posted: Mon Mar 11, 2002 5:23 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
At a quick guess I would say it has something to do with the representation of integer numebrs. On intel based machines it is little endian while on unix it is big endian. How are you building the PCF messages? If by hand, consider the use of the MQAI package. |
|
Back to top |
|
 |
kolthorr |
Posted: Mon Mar 11, 2002 2:21 pm Post subject: |
|
|
Apprentice
Joined: 09 Mar 2002 Posts: 31
|
Thanks for the tip! That would seem to be a plausible reason (although I thought MQ was supposed to handle those sort of conversions in messages?). I am indeed building the PCF by hand. I will investigate the MQAI as an alternative.
Regards,
Andrew Wright |
|
Back to top |
|
 |
kolthorr |
Posted: Mon Mar 11, 2002 10:16 pm Post subject: |
|
|
Apprentice
Joined: 09 Mar 2002 Posts: 31
|
Hi again (in reponse to my original post),
Yep, it is an endian issue. The code will have to detect what platform it's running on and convert/not convert appropriately.
Someone suggested MQ only converts messages of format MQSTR, which is why it isn't converting the Admin formatted message coming from the command server. Is this correct? (Just wondering for my own interest).
Regards,
Andrew Wright |
|
Back to top |
|
 |
EddieA |
Posted: Tue Mar 12, 2002 10:49 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
MQ will convert any message where the format is known.
What did you put in the MQMD Format. Have you tried MQADMIN.
Cheers,
_________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
mrlinux |
Posted: Tue Mar 12, 2002 11:13 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
When building messages for MQSeries use the following C calls, Iam sure they
are available in other Languages
On intel the following will byte swap on all other platforms that are big endian it doesnt do anything.
To convert from Host to Network
htons short integer
htonl long
To convert from Network to Host
ntohs short integer
ntohl long
_________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
kolthorr |
Posted: Tue Mar 12, 2002 8:37 pm Post subject: |
|
|
Apprentice
Joined: 09 Mar 2002 Posts: 31
|
Hi again,
I finally worked out the problem - I am first doing an MQGET with browse to get the size of the PCF message, then a second GET to actually retrieve it. I was setting the Encoding and CCSID fields in the MD before the first get, but not before the second. MQ was changing the values on the output of the first get, which was then getting fed into the second GET call, and messing things up.
Easily fixed! MQ does handle the conversions when you tell it the right things after all!
Thanks to all who replied and helped along the way.
Kind regards,
Andrew Wright |
|
Back to top |
|
 |
rajpath |
Posted: Wed Jun 12, 2002 9:56 pm Post subject: PCF Commands |
|
|
Novice
Joined: 12 Jun 2002 Posts: 12 Location: Mumbai
|
Can u show the code for PCF used on Windows NT.In fact I am new to the same.Just trying PCF commands on WindowsNT.Please response ASAP. _________________ Raj
Software Engineer
Mahindra Consulting Ltd
Mumbai-101 India |
|
Back to top |
|
 |
|