Author |
Message
|
maxyen |
Posted: Sat Feb 04, 2006 2:46 pm Post subject: Message Identifier format conversion from ASCII to EBCDIC |
|
|
Newbie
Joined: 08 Aug 2002 Posts: 8
|
Our application is receiving ascii in the message identifier, however the AS400 application polling the queue cannot read the message indentifier in ASCII, we need it in EBCDIC. How can this be done? Is there an Mq Setting to convert the message id format from ASCII to EBCDIC?
Any suggestions would be greatly appreciated.
Thanks in advance.
M.Y |
|
Back to top |
|
 |
PeterPotkay |
Posted: Sat Feb 04, 2006 3:35 pm Post subject: Re: Message Identifier format conversion from ASCII to EBCDI |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
maxyen wrote: |
Is there an Mq Setting to convert the message id format from ASCII to EBCDIC? |
No. The Msg ID, Crl ID and Act Token are bytes fields, and are not converted. Its bad design to treat those fields as anything other than a byte stream.
If you must convert (and you really shouldn't be going down this path, do a search on this site for message ID and convert), you will have to write your own conversion routine for that field.
Why do you want to do this? _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
maxyen |
Posted: Sat Feb 04, 2006 6:59 pm Post subject: |
|
|
Newbie
Joined: 08 Aug 2002 Posts: 8
|
Well, our queue manager is on the AS/400 and we are receiving messages (xml and attachments) from a Windows box. We are looking for specific message in the queue and the way we are doing it is to retrieve message from the queue with a specific message id (xml) and retrieve attachments ultimately. The issue is Windows sent the "key" specified in the message id in ASCII and AS/400 understands EBCDIC. I thought the main purpose of the messsage id is to enable filtering of messages. Am I using it incorrectly and are there other alternatives?
Thanks. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Feb 04, 2006 8:20 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
maxyen wrote: |
I thought the main purpose of the messsage id is to enable filtering of messages. Am I using it incorrectly and are there other alternatives? |
You are quite right here however you're as well under some misconception.
The messageId/CorrelationId are not "Human Identifiable" fields. They are to be compared byte by byte and treated as byte array.
They are part of the "anonymous" identifier pattern.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
HubertKleinmanns |
Posted: Mon Feb 06, 2006 10:29 am Post subject: |
|
|
 Shaman
Joined: 24 Feb 2004 Posts: 732 Location: Germany
|
The sense of the msgId and correlId is, to correlate a question and its answer. In this case you would create a request message and remember the msgId. The requested application would copy the msgId into the correlId of an answer (reply) message and sends it back. The requester now can "find" the answer to its question. In the scenario above there is no need, to convert the msgId.
When to want to "filter" message ist only works, when the created msgId is of a readable format on the target QMgr. A "trick" would be, to set the msg ID on your windows system to values, which are unreadable on windows, but on AS/400 they "look like" readable characters.
Another (and better) solution would be, to put your "filter attribute" into the message data. When you use XML it should be quite easy, to add an additional field which contains the filter attribute.
Your applications should always read every message and filter the messages itself. May be, you put the messages to a database and put an index or key onto your filter attributes. _________________ Regards
Hubert |
|
Back to top |
|
 |
maxyen |
Posted: Mon Feb 06, 2006 7:32 pm Post subject: |
|
|
Newbie
Joined: 08 Aug 2002 Posts: 8
|
Thanks, we had it working by converting EBCDIC to ASCII on the get. Now, we can read the message id and are receiving readable xml file but pdf and jpg are not readable. We tried combinations of MQSTR and channel conversion (yes/no) without success.
I'm not sure what to try next. I noticed the message has an encoding cp437 but the sender informed us that they are not using any encoding for the put; may be it's just the default.
Any suggestions? |
|
Back to top |
|
 |
Srinivasan |
Posted: Mon Feb 06, 2006 9:37 pm Post subject: |
|
|
Apprentice
Joined: 12 Jul 2005 Posts: 41 Location: Chennai
|
http://czyborra.com/charsets/codepages.html
Find the code pages in the above link. The default code page for the sending system ishould be CP437. Hope this helps for you. _________________ Srinivasan for MQ discussion |
|
Back to top |
|
 |
|