ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » Can MQ change message format?

Post new topic  Reply to topic
 Can MQ change message format? « View previous topic :: View next topic » 
Author Message
MQMB&WAS
PostPosted: Thu Jul 09, 2020 9:31 pm    Post subject: Can MQ change message format? Reply with quote

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
View user's profile Send private message
exerk
PostPosted: Fri Jul 10, 2020 1:38 am    Post subject: Reply with quote

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
View user's profile Send private message
gbaddeley
PostPosted: Sun Jul 12, 2020 3:26 pm    Post subject: Re: Can MQ change message format? Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2494
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
View user's profile Send private message
hughson
PostPosted: Sun Jul 12, 2020 4:45 pm    Post subject: Re: Can MQ change message format? Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
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
View user's profile Send private message Visit poster's website
MQMB&WAS
PostPosted: Wed Jul 15, 2020 12:40 am    Post subject: Re: Can MQ change message format? Reply with quote

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
View user's profile Send private message
hughson
PostPosted: Wed Jul 15, 2020 2:15 am    Post subject: Re: Can MQ change message format? Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
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
View user's profile Send private message Visit poster's website
MQMB&WAS
PostPosted: Wed Jul 15, 2020 5:20 pm    Post subject: Re: Can MQ change message format? Reply with quote

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
View user's profile Send private message
hughson
PostPosted: Wed Jul 15, 2020 5:34 pm    Post subject: Re: Can MQ change message format? Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
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
View user's profile Send private message Visit poster's website
MQMB&WAS
PostPosted: Thu Jul 16, 2020 4:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Fri Jul 17, 2020 6:27 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
hughson
PostPosted: Mon Jul 20, 2020 12:55 am    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
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
View user's profile Send private message Visit poster's website
MQMB&WAS
PostPosted: Mon Sep 21, 2020 6:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
hughson
PostPosted: Tue Sep 22, 2020 2:23 am    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
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
View user's profile Send private message Visit poster's website
bruce2359
PostPosted: Tue Sep 22, 2020 2:34 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9396
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
View user's profile Send private message
MQMB&WAS
PostPosted: Tue Sep 22, 2020 5:10 pm    Post subject: Reply with quote

Centurion

Joined: 12 Jun 2016
Posts: 130

Thank you Morag and Bruce2359
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » Can MQ change message format?
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.