Author |
Message
|
MQMB&WAS |
Posted: Thu Jul 09, 2020 9:31 pm Post subject: Can MQ change message format? |
|
|
Centurion
Joined: 12 Jun 2016 Posts: 130
|
Hello,
Can MQ change message format of a message that an app puts yo MQ?? For example: if the app puts a message in mqstr format, can MQ change it to Mqrfh2 format? Also I couldn’t understand the usage of propctl property on the queue. |
|
Back to top |
|
|
exerk |
Posted: Fri Jul 10, 2020 1:38 am Post subject: |
|
|
Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
Thinking logically, would you want MQ changing attributes of your messages?
As regards propctl, the KC is quite clear on the subject:
Quote: |
Use the PROPCTL queue attribute to control how message properties are returned to an application that calls MQGET without setting any MQGMO message property options. |
_________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
|
gbaddeley |
Posted: Sun Jul 12, 2020 3:26 pm Post subject: Re: Can MQ change message format? |
|
|
Jedi Knight
Joined: 25 Mar 2003 Posts: 2527 Location: Melbourne, Australia
|
MQMB&WAS wrote: |
Can MQ change message format of a message that an app puts yo MQ?? For example: if the app puts a message in mqstr format, can MQ change it to Mqrfh2 format? |
Yes, if the message contains Message Properties. However, when an app gets the message data, it is presented in the original format, eg. MQSTR. _________________ Glenn |
|
Back to top |
|
|
hughson |
Posted: Sun Jul 12, 2020 4:45 pm Post subject: Re: Can MQ change message format? |
|
|
Padawan
Joined: 09 May 2013 Posts: 1948 Location: Bay of Plenty, New Zealand
|
MQMB&WAS wrote: |
Can MQ change message format of a message that an app puts yo MQ?? For example: if the app puts a message in mqstr format, can MQ change it to Mqrfh2 format? |
If an application puts a message in MQSTR format, and also adds message properties (or an exit intervenes and adds message properties, or it is a pub/sub message and the pub/sub engine adds message properties), then the getter may be given a message with the format MQRFH2 if it is not capable of dealing with message properties.
To be considered capable of dealing with message properties, an application has to provide a message handle when it does the MQGET. If it does not, then message properties are flattened into an MQRFH2 format unless the PROPCTL queue attribute says otherwise.
MQMB&WAS wrote: |
Also I couldn't understand the usage of propctl property on the queue. |
The PROPCTL queue attribute comes into play for applications that have not provided a message handle on the MQGET. In this case you may have applications that are not expecting to receive a message in MQRFH2 format (sounds like this might be your problem). If you wish to supress the message property data from being given to the getter, you can alter the queue to use PROPCTL(NONE). There are other settings too, but mainly this is the one that is needed by most people.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
|
MQMB&WAS |
Posted: Wed Jul 15, 2020 12:40 am Post subject: Re: Can MQ change message format? |
|
|
Centurion
Joined: 12 Jun 2016 Posts: 130
|
hughson wrote: |
The PROPCTL queue attribute comes into play for applications that have not provided a message handle on the MQGET. In this case you may have applications that are not expecting to receive a message in MQRFH2 format (sounds like this might be your problem). If you wish to supress the message property data from being given to the getter, you can alter the queue to use PROPCTL(NONE). There are other settings too, but mainly this is the one that is needed by most people.
Cheers,
Morag |
Thanks for your time, Morag and others.
The issue we have is, theres' an app that puts messages to DEV & PERF queues (not sure what the message props are ), when we browse the queue, msgs are in MQSTR format and the receiving app also gets the messages in MQSTR format.
Now with the same apps, In PROD, queue browse shows messages are in MQRFH2 format and the receiving app also gets msgs in MQRFH2 format.
The only difference I see in the queue definitions is, PROPCTL(NONE) in DE/PERF vs PROPCTL(V6COMPAT) in PROD.
so is this difference in the queue property the cause for the difference in msg formats ? or could the apps be doing something different in TEST vs PROD ?? What needs to be done on the queue/apps so the receiving app gets the messages in MQSTR format in all environments?
Thanks for your time. |
|
Back to top |
|
|
hughson |
Posted: Wed Jul 15, 2020 2:15 am Post subject: Re: Can MQ change message format? |
|
|
Padawan
Joined: 09 May 2013 Posts: 1948 Location: Bay of Plenty, New Zealand
|
MQMB&WAS wrote: |
The only difference I see in the queue definitions is, PROPCTL(NONE) in DEV/PERF vs PROPCTL(V6COMPAT) in PROD. |
That'll do it!
MQMB&WAS wrote: |
so is this difference in the queue property the cause for the difference in msg formats ? or could the apps be doing something different in TEST vs PROD ?? What needs to be done on the queue/apps so the receiving app gets the messages in MQSTR format in all environments? |
While it is possible that the apps are *ALSO* doing something different, the difference in the PROPCTL attribute certainly explains the behaviour they are seeing.
Here's what appears to be happening, assuming you are running identical applications in both environments mentioned.
In DEV/PERF- The application puts its messages which include some message properties.
- The getting application does not use a message handle, and gets the messages. They are MQSTR messages. The message properties were discarded as a result of PROPCTL(NONE).
In PROD- The application puts its messages which include some message properties
- The getting application does not use a message handle, and gets the messages. Since there is no message handle to populate with the message properties, they are flattened into an MQRFH2 header and placed on the front of the message returned to the getter. The message properties are not discarded because of the setting PROPCTL(V6COMPAT).
The default value of PROPCTL is COMPACT (not V6COMPAT). So it may be wise to understand why the queue in PROD is defined in this way before making a change to it. Do some other applications rely on that setting?
If you alter DEV/PERF to be PROPCTL(V6COMPAT) you should see the same thing you are seeing in PROD.
If you alter PROD to be PROPCTL(NONE) then your getter will no longer see the MQRFH2, but there may be other applications reading from this queue who are relying on being given the MQRFH2 with the flattened message properties.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
|
MQMB&WAS |
Posted: Wed Jul 15, 2020 5:20 pm Post subject: Re: Can MQ change message format? |
|
|
Centurion
Joined: 12 Jun 2016 Posts: 130
|
hughson wrote: |
If you alter PROD to be PROPCTL(NONE) then your getter will no longer see the MQRFH2, but there may be other applications reading from this queue who are relying on being given the MQRFH2 with the flattened message properties.
Cheers,
Morag |
Thanks so much, Morag.
If the queue is altered to PROPCTL(NONE), would I see MQSTR in the messages if I browse the queue ? or does the format change MQRFH2 to MQSTR only when the receiving app GETS the messages ?
Thanks again. |
|
Back to top |
|
|
hughson |
Posted: Wed Jul 15, 2020 5:34 pm Post subject: Re: Can MQ change message format? |
|
|
Padawan
Joined: 09 May 2013 Posts: 1948 Location: Bay of Plenty, New Zealand
|
MQMB&WAS wrote: |
hughson wrote: |
If you alter PROD to be PROPCTL(NONE) then your getter will no longer see the MQRFH2, but there may be other applications reading from this queue who are relying on being given the MQRFH2 with the flattened message properties.
Cheers,
Morag |
Thanks so much, Morag.
If the queue is altered to PROPCTL(NONE), would I see MQSTR in the messages if I browse the queue ? or does the format change MQRFH2 to MQSTR only when the receiving app GETS the messages ?
Thanks again. |
The behaviour is the same for MQGET with or without MQOO_BROWSE
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
|
MQMB&WAS |
Posted: Thu Jul 16, 2020 4:21 pm Post subject: |
|
|
Centurion
Joined: 12 Jun 2016 Posts: 130
|
Thank you Morag.
I've also come across TARGETCLIENT setting at the sending application. When does this come into picture and how does it affect the message format?? |
|
Back to top |
|
|
fjb_saper |
Posted: Fri Jul 17, 2020 6:27 am Post subject: |
|
|
Grand High Poobah
Joined: 18 Nov 2003 Posts: 20729 Location: LI,NY
|
MQMB&WAS wrote: |
Thank you Morag.
I've also come across TARGETCLIENT setting at the sending application. When does this come into picture and how does it affect the message format?? |
when defining your queue to JMS you can also use the format
queue://QMNAME/QNAME?targetClient=1
You have 2 possible values 0 and 1. IIRC 1 means targetClient = MQ and as such the properties are dropped. targetClient=0 would mean JMS and the properties are written to the message, either as properties or as RFH header depending on the propctl.
Note that the JMS consumer does not care either way and handles the properties. This is mainly for the JMS producer, to produce an MQ message without properties. Enjoy _________________ MQ & Broker admin |
|
Back to top |
|
|
hughson |
Posted: Mon Jul 20, 2020 12:55 am Post subject: |
|
|
Padawan
Joined: 09 May 2013 Posts: 1948 Location: Bay of Plenty, New Zealand
|
Use of targetclient also has one extra consideration which is different from PROPCTL(NONE).
Targetclient=1 means that the message properties are never added to the message so if the getting application IS capable of using them, it can never be given them.
PROPCTL(NONE) means that the message properties are in the message but are only stripped from the message given to the getter if the getter does not supply a message handle.
So PROPCTL(NONE) allows the decision about giving message properties to the getting application to be made at GET time rather than an PUT time. If you have a mixture of message property capable and non-capable applications, you don't have to run with the lowest common denominator.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
|
MQMB&WAS |
Posted: Mon Sep 21, 2020 6:39 pm Post subject: |
|
|
Centurion
Joined: 12 Jun 2016 Posts: 130
|
Where do I need to set the PROPCTL(NONE) to strip off the mqrfh header in the below flow?
QM1
QREMOTE1
XMITQ1
QM2
QALIAS1
QLOCAL1
Is it enough if I set PROPCTL(NONE) on just the QALIAS1 & QLOCAL1 on QM2 ?
Or does it needs to be set on all the queues involved in the flow? QREMOTE, XMITQ, QALIAS, QLOCAL?
Thanks for your time. |
|
Back to top |
|
|
hughson |
Posted: Tue Sep 22, 2020 2:23 am Post subject: |
|
|
Padawan
Joined: 09 May 2013 Posts: 1948 Location: Bay of Plenty, New Zealand
|
MQMB&WAS wrote: |
Where do I need to set the PROPCTL(NONE) to strip off the mqrfh header in the below flow?
QM1
QREMOTE1
XMITQ1
QM2
QALIAS1
QLOCAL1
Is it enough if I set PROPCTL(NONE) on just the QALIAS1 & QLOCAL1 on QM2 ?
Or does it needs to be set on all the queues involved in the flow? QREMOTE, XMITQ, QALIAS, QLOCAL?
Thanks for your time. |
Set PROPCTL(NONE) on the queue that the Getting application uses.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
|
bruce2359 |
Posted: Tue Sep 22, 2020 2:34 am Post subject: |
|
|
Poobah
Joined: 05 Jan 2008 Posts: 9442 Location: US: west coast, almost. Otherwise, enroute.
|
hughson wrote: |
MQMB&WAS wrote: |
Where do I need to set the PROPCTL(NONE) to strip off the mqrfh header in the below flow?
QM1
QREMOTE1
XMITQ1
QM2
QALIAS1
QLOCAL1
Is it enough if I set PROPCTL(NONE) on just the QALIAS1 & QLOCAL1 on QM2 ?
Or does it needs to be set on all the queues involved in the flow? QREMOTE, XMITQ, QALIAS, QLOCAL?
Thanks for your time. |
Set PROPCTL(NONE) on the queue that the Getting application uses.
Cheers,
Morag |
The first object name that the consuming (MQGETting) application uses at MQOPEN. If the app names a QAlias, set the PROPCTL at the QAlias. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
|
MQMB&WAS |
Posted: Tue Sep 22, 2020 5:10 pm Post subject: |
|
|
Centurion
Joined: 12 Jun 2016 Posts: 130
|
Thank you Morag and Bruce2359 |
|
Back to top |
|
|
|