|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Problem with encoding on messages being received |
« View previous topic :: View next topic » |
Author |
Message
|
James_O_K |
Posted: Thu Mar 09, 2006 3:12 am Post subject: Problem with encoding on messages being received |
|
|
Apprentice
Joined: 09 Mar 2006 Posts: 39 Location: UK
|
Hello all, its my first post so bare with me.
I am getting messages from a local queue manager/queue using a java client. The messages seem to be encoded in some way, could be EBCDIC but I dont know for sure. When I browse them (either programatically or using MQ Visual Browse) I can not read the content.
Looking on various forums at the issue of encoding its stated that when you do the get you should include in the MQGetMessageOptions the constant MQGMO_CONVERT. Which will then handle conversion to local character set.
My get options are set as:
getMessageOptions.options = MQC.MQGMO_NO_WAIT | MQC.MQGMO_CONVERT | MQC.MQGMO_ACCEPT_TRUNCATED_MSG | MQC.MQGMO_FAIL_IF_QUIESCING;
But this does not make any difference when getting message. Has anyone else come across this kind of problem? Can anyone advise on how they have done EBCDIC to ASCII message conversion?
Thanks in advance
James. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 09, 2006 3:40 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Hi,
Forgive me, but office policy forbids me going bare with you (it's also potentiallya public order offence given my body shape)!
Having got the really, really obvious joke out of the way, the options look right so here are some really, really obvious things to check:
1) Make sure the application you're using (I have no famliarity with MQ Visual Browse) does display the message as text. I have seen a (rather odd home grown) application which retrieved the message as a byte stream and dumped that to the screen.
2) Make sure the message is in fact text and not encoded (object, database row or similar)
3) Check the code pages (CCSID) of the queue managers involved. MQGMO_CONVERT moves the message from the sending one to the receiving one, which can be different to the local character set. It could be that its been misset.
Failing that, can you post details of sending/receiving platforms, OS & MQ levels and the version of Java you're using? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
James_O_K |
Posted: Thu Mar 09, 2006 4:19 am Post subject: |
|
|
Apprentice
Joined: 09 Mar 2006 Posts: 39 Location: UK
|
Vitor wrote: |
Hi,
Forgive me, but office policy forbids me going bare with you (it's also potentiallya public order offence given my body shape)!
Having got the really, really obvious joke out of the way, the options look right so here are some really, really obvious things to check:
1) Make sure the application you're using (I have no famliarity with MQ Visual Browse) does display the message as text. I have seen a (rather odd home grown) application which retrieved the message as a byte stream and dumped that to the screen.
2) Make sure the message is in fact text and not encoded (object, database row or similar)
3) Check the code pages (CCSID) of the queue managers involved. MQGMO_CONVERT moves the message from the sending one to the receiving one, which can be different to the local character set. It could be that its been misset.
Failing that, can you post details of sending/receiving platforms, OS & MQ levels and the version of Java you're using? |
Thanks for quick response, some offices are just not as free thinking eh? Mind you, even spell check wouldnt have picked bare rather than bear up!
Your first point is a good one, I have been assuming the messages are EBCDIC because thats what I was told by someone further up the wire. The MQ Visual browse program does not show messages in plain text (although messages from other systems are displayed as text).
CCSID on local qmgr is 819 which I believe is ACII.
Sender is Windows 2003 with MQ 5.3 and receiver is AIX with MQ 5.3. Java 1.4.1. The messages get routed via a mainframe, but I believe all the mainframe program does is route (ie no transformation) as other messages I receive are in plain text and also come via mainframe routing app. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 09, 2006 4:29 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
It's one of those spelling mistakes which the technology will not save you from.
You don't mention which CSD of 5.3 you're on. Found this on the IBM site:
http://www-1.ibm.com/support/docview.wss?uid=swg1IC39432
It may pertain? Or it may not.
It might be worth double checking that the problem message comes via the same channel as the others & if not, the CONVERT option is not set on the channel (highly unlikely but worth just ticking off). _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Mar 09, 2006 5:26 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
James,
Set your MQSERVER variable and then use amqsbcgc to browse that queue. In particular, see if the MQMD_FORMAT field in the header of that messages is set to "MQSTR ". If its not, your request for conversion will not work. To fix it, the sender app will need to set that field to MQSTR, assuming off course the message in questio is nothing but character data and a canidate for MQ's built in conversion capability. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 09, 2006 5:41 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
PeterPotkay wrote: |
James,
Set your MQSERVER variable and then use amqsbcgc to browse that queue. In particular, see if the MQMD_FORMAT field in the header of that messages is set to "MQSTR ". If its not, your request for conversion will not work. To fix it, the sender app will need to set that field to MQSTR, assuming off course the message in questio is nothing but character data and a canidate for MQ's built in conversion capability. |
I missed the most obvious really, really obvious.... MQMD_FORMAT......  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
James_O_K |
Posted: Wed Apr 26, 2006 6:43 am Post subject: |
|
|
Apprentice
Joined: 09 Mar 2006 Posts: 39 Location: UK
|
Thanks for all your help on this, just realised I forgot to let you know how I solved. It was actually a problen with a CCSID being set to 0 rather than 850. I got the person up the wire to set to to 850 and now all works. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|