Author |
Message
|
bikara |
Posted: Sun Jul 12, 2009 7:44 pm Post subject: Understanding GMO_CONVERT |
|
|
Newbie
Joined: 03 Jul 2009 Posts: 3
|
New to MQ and I'm trying to understand GMO_CONVERT option.
If message on queue has following format.
MQMD
MQRFH2
MQDLH
<bunch of other headers>
User data
Now if in GET call I specify, FMT_STRING in format field of MQMD, what will happen? Will I just get MQMD and User Data? |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Jul 12, 2009 9:31 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
No.
MQGMO_CONVERT only applies to messages that have in their last header MQFMT_STRING. Remember headers are a chained construct and the last header's format points to the format of the payload.
So if your payload has a format of MQFMT_STRING and the ccsid of the payload is translatable to the ccsid on the request the payload will get converted from one CCSID to the other.
You should be especially careful here: IIRC if you try to translate this way a message in CCSID 500 to 1208 and your qmgr's ccsid is 819 you may loose information as the translation may go like this 500->819->1208... and the step through ccsid 819 may loose characters that cannot be represented in that ccsid...
This is why when using WebSphere Message Broker it is better not to set the convert option.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
vol |
Posted: Sun Jul 12, 2009 10:38 pm Post subject: |
|
|
Acolyte
Joined: 01 Feb 2009 Posts: 69
|
Quote: |
MQGMO_CONVERT only applies to messages that have in their last header MQFMT_STRING. |
This is not correct. Nearly all of the standard WMQ headers, including RFH2 and DLH, can be converted by MQGET. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jul 13, 2009 12:31 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
vol wrote: |
Quote: |
MQGMO_CONVERT only applies to messages that have in their last header MQFMT_STRING. |
This is not correct. Nearly all of the standard WMQ headers, including RFH2 and DLH, can be converted by MQGET. |
Yes it is correct. The standard headers are subject to different rules, those that contain data (the RFH2 the obvious example) has a CCSID describing it. Convert on get is specific to the payload of the message. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Mon Jul 13, 2009 6:22 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
If you have a conversion exit called MqIsCool, and the format of your message is MqIsCool, the convert option can be used.
The only default conversion exit supplied with a basic MQ install is the one that works with MQFMT_STRING. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
vol |
Posted: Mon Jul 13, 2009 9:59 pm Post subject: |
|
|
Acolyte
Joined: 01 Feb 2009 Posts: 69
|
Please see the APR, appendix F:
Quote: |
Processing conventions
When converting a built-in format, the queue manager follows the processing conventions described below. User-written exits should also follow these conventions, although this is not enforced by the queue manager. The built-in formats converted by the queue manager are:
MQFMT_ADMIN
MQFMT_CICS (z/OS only)
MQFMT_COMMAND_1
MQFMT_COMMAND_2
MQFMT_DEAD_LETTER_HEADER
MQFMT_DIST_HEADER
MQFMT_EVENT version 1
MQFMT_EVENT version 2 (z/OS only)
MQFMT_IMS
MQFMT_IMS_VAR_STRING
MQFMT_MD_EXTENSION
MQFMT_PCF
MQFMT_REF_MSG_HEADER
MQFMT_RF_HEADER
MQFMT_RF_HEADER_2
MQFMT_STRING
MQFMT_TRIGGER
MQFMT_WORK_INFO_HEADER (z/OS only)
MQFMT_XMIT_Q_HEADER
|
As it says, all these formats are converted inside the qmgr, or to be more accurate, in the app after control has passed back from the qmgr (agent) and before returning to user code. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 14, 2009 12:55 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
vol wrote: |
As it says, all these formats are converted inside the qmgr, or to be more accurate, in the app after control has passed back from the qmgr (agent) and before returning to user code. |
Quite; my point (however badly phrased) is that these headers are converted as you point out irrespective of the get option, which refers to the payload. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|