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 IndexIBM MQ Java / JMSMQ priority in Explorer for JMS application

Post new topicReply to topic
MQ priority in Explorer for JMS application View previous topic :: View next topic
Author Message
rickwatsonb
PostPosted: Tue Jan 06, 2015 2:33 pm Post subject: MQ priority in Explorer for JMS application Reply with quote

Voyager

Joined: 15 Aug 2006
Posts: 87
Location: USA: Mid-West

Hi,

Besides what is displayed via MQ Explorer, how can I prove what priority has been set by a JMS application on a message? What do I need to tell the developers to do a search on in their code, e.g. MQDestination.setPriority? What else can I analyze?

I can see that the priority is listed per message in MQ Explorer. But, how can it be proven that the JMS application is programmatically setting the priority to what I see in MQ Explorer?

This question has come about because the JMS messages include “priority=9” in the message body, but the actual priority displayed in MQ Explorer is “4”.

The feedback that I have given the batch team is that the text “priority=9” in the message is just “text” and is not read by the MQ queue manager as an actual MQ priority setting. In other words, “priority=9” in the message could be changed to “priority=XYZ” and MQ would not know the difference because it is not the actual MQ priority set on the message, it is just message “text”.

(We are on Linux with MQ server 7.1.0.2, and have a JMS client connecting to the queue manager via a stand-alone application and WAS 8.5.0.2.)

Thanks in advance for your help.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jan 07, 2015 4:58 am Post subject: Re: MQ priority in Explorer for JMS application Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

rickwatsonb wrote:
What do I need to tell the developers to do a search on in their code, e.g. MQDestination.setPriority? What else can I analyze?


The message priority in WMQ terms maps directly in JMS terms to the property JMSPriority (unsuprisingly!). See here

rickwatsonb wrote:
I can see that the priority is listed per message in MQ Explorer. But, how can it be proven that the JMS application is programmatically setting the priority to what I see in MQ Explorer?


It can be proven because the application always sets the priority of a message, the queue manager never does. In many cases the application sets the priority to "whatever the default priority on the queue is" by not actually setting it to anything programatically, but the concept holds.

Check the queue in question to see the value of the default priority. Does it match the value you're actually seeing on a put message? Does it change if the code remains the same but you alter the default value on the queue? If the application is deliberately setting it, no change to the queue setting will be effective.

rickwatsonb wrote:
This question has come about because the JMS messages include “priority=9” in the message body, but the actual priority displayed in MQ Explorer is “4”.

The feedback that I have given the batch team is that the text “priority=9” in the message is just “text” and is not read by the MQ queue manager as an actual MQ priority setting. In other words, “priority=9” in the message could be changed to “priority=XYZ” and MQ would not know the difference because it is not the actual MQ priority set on the message, it is just message “text”.


If it really is text in the message body then you're quite right. I'll leave it to someone with more JMS knowledge than myself to comment on if you can set the priority by putting "priority=9" as a name value pair in a connection string, in a JMS header or other Java-ish magic.

And if it's possible, what your developers may have done wrong to not get a value of 9 in the resulting message.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jan 07, 2015 6:22 am Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

Probably using message properties and not using setJMSPriority method
This would make it a user property with name value pair...

_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
rickwatsonb
PostPosted: Wed Jan 07, 2015 6:24 am Post subject: Reply with quote

Voyager

Joined: 15 Aug 2006
Posts: 87
Location: USA: Mid-West

Vitor - Thankyou very much for your quick reply and helpful information.

For those who are more familiar with JMS and XML messages relative to MQ, I have added an example of two messages where the "priority=9" in each of the XML message "Action" tags, but the actual MQ priority displayed in MQ Explorer is set to "3" for the "STOP" message, and "4" for the "RUN_UPDATE" message.

Code:
MQ Explorer Priority = 3
<?xml version="1.0" encoding="UTF-8"?>
<FwMessage><FwHeader><Route queue="queueA" queueManager="QMGR1" messageId="messageIdVal" corrId="corrIdVal" /><Originator sourceId="sourceIdVal" sessionId="sessionIdVal" /><Action actionId="RESPONSE" serviceId="STOP" priority="9" /></FwHeader><FwFooter /><FwBody><ExyzVO /></FwBody></FwMessage>


Code:
MQ Explorer Priority = 4
<?xml version="1.0" encoding="UTF-8"?>
<FwMessage><FwHeader><Route queue="queueA" queueManager="QMGR1" messageId="messageIdVal" corrId="corrIdVal" /><Originator sourceId="sourceIdVal" sessionId="sessionIdVal" /><Action actionId="RESPONSE" serviceId="RUN_UPDATE" priority="9" /></FwHeader><FwBody><ATxyzVO ssCaseXrefSeqNum="1234567" /></FwBody></FwMessage>


Is it still correct to say that the priority value set in the XML message "Action" tag is ignored by MQ and does not specify the actual MQ priority?

Thank you in advance for your help.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jan 07, 2015 6:33 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

rickwatsonb wrote:
Is it still correct to say that the priority value set in the XML message "Action" tag is ignored by MQ and does not specify the actual MQ priority?


Yes, that's not going to work but......

...neither is the "messageIdVal", "corrIdVal" and other JMS/MQ like variables. It looks almost like something is expected to parse that message and replace those variables before it's actually put; if so, maybe that's supposed to see the priority field and react accordingly.

But that would be custom code at your end. If that message, as posted, were put to a queue it would get the default queue priority because nothing in MQ or JMS would parse the message body to see it. To change that you need to set the JMSPriority or (as my worthy associate points out) set a message property.

The experiments I alude to in my earlier post will help.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jan 07, 2015 6:44 am Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

The XML content of the message looks like a routing header, with some information being potentially actionable, some just being historic (like a message id in JMS)...
The message payload seems to be divided in 2 parts:
an infrastructure payload represented by a header
an application payload (here in the FwBody)...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
rickwatsonb
PostPosted: Wed Jan 07, 2015 6:48 am Post subject: Reply with quote

Voyager

Joined: 15 Aug 2006
Posts: 87
Location: USA: Mid-West

Thank you for the feedback.

All I have found relative to setting the MQ priority on the queue is the attribute MSGDLVSQ(PRIORITY). Is there something else on the MQ admin side that can set the priority per message? I do not believe so...

Code:
AMQ8409: Display Queue details.
   QUEUE(queueA)             TYPE(QLOCAL)
   ACCTQ(QMGR)                             ALTDATE(2014-05-11)
   ALTTIME(10.25.20)                       BOQNAME( )
   BOTHRESH(0)                             CLUSNL( )
   CLUSTER( )                              CLWLPRTY(0)
   CLWLRANK(0)                             CLWLUSEQ(QMGR)
   CRDATE(2013-10-20)                      CRTIME(08.16.23)
   CURDEPTH(244)                           CUSTOM( )
   DEFBIND(OPEN)                           DEFPRTY(0)
   DEFPSIST(YES)                           DEFPRESP(SYNC)
   DEFREADA(NO)                            DEFSOPT(SHARED)
   DEFTYPE(PREDEFINED)                     DESCR( )
   DISTL(NO)                               GET(ENABLED)
   HARDENBO                                INITQ( )
   IPPROCS(10)                             MAXDEPTH(9999999)
   MAXMSGL(10000000)                       MONQ(MEDIUM)
   MSGDLVSQ(PRIORITY)                      NOTRIGGER
   NPMCLASS(NORMAL)                        OPPROCS(9)
   PROCESS( )                              PUT(ENABLED)
   PROPCTL(COMPAT)                         QDEPTHHI(80)
   QDEPTHLO(20)                            QDPHIEV(DISABLED)
   QDPLOEV(DISABLED)                       QDPMAXEV(ENABLED)
   QSVCIEV(NONE)                           QSVCINT(999999999)
   RETINTVL(999999999)                     SCOPE(QMGR)
   SHARE                                   STATQ(QMGR)
   TRIGDATA( )                             TRIGDPTH(1)
   TRIGMPRI(0)                             TRIGTYPE(FIRST)
   USAGE(NORMAL)
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jan 07, 2015 6:57 am Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

How could you miss DEFPRTY ???
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
zpat
PostPosted: Wed Jan 07, 2015 7:00 am Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
Location: UK

You can also create several alias queues with different default priorities for the same base queue, and then use the appropriate alias queue name to set the priority.
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jan 07, 2015 7:22 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

rickwatsonb wrote:
All I have found relative to setting the MQ priority on the queue is the attribute MSGDLVSQ(PRIORITY). Is there something else on the MQ admin side that can set the priority per message? I do not believe so...


I do!

rickwatsonb wrote:
Code:
DEFPRTY(0)


Note that's the default value. If the application sets the priority value, nothing the admin can do will override the application set value.

If this is the definition of the queue in question, then the only way you can be getting a value of 4 or 9 is if the application sets it somehow.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jan 07, 2015 7:22 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

zpat wrote:
You can also create several alias queues with different default priorities for the same base queue, and then use the appropriate alias queue name to set the priority.


Just sets the defaults; doesn't set the priority.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Wed Jan 07, 2015 8:31 am Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7717

Vitor wrote:

rickwatsonb wrote:
Code:
DEFPRTY(0)


Note that's the default value. If the application sets the priority value, nothing the admin can do will override the application set value.


Its rare and thus unlikely, but is possible the admin has installed an API Exit to change the priority of all messages with let's say "Vitor" in the payload to Priority 9, regardless of what the app coded or the queue's Default Priority value is.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jan 07, 2015 12:47 pm Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

and BTW the only priority 9 should be the administrators. Any other priority stops at 8
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
zpat
PostPosted: Wed Jan 07, 2015 2:34 pm Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
Location: UK

Vitor wrote:
zpat wrote:
You can also create several alias queues with different default priorities for the same base queue, and then use the appropriate alias queue name to set the priority.


Just sets the defaults; doesn't set the priority.


The point is that the application can choose the priority by choosing the alias queue (assuming the default MQI option which takes the default queue priority). In fact it doesn't even need any code changes - which is often useful.

I used the word can - in my world - this means it is an option, which it is.
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Jan 08, 2015 4:53 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

PeterPotkay wrote:
Vitor wrote:

rickwatsonb wrote:
Code:
DEFPRTY(0)


Note that's the default value. If the application sets the priority value, nothing the admin can do will override the application set value.


Its rare and thus unlikely, but is possible the admin has installed an API Exit to change the priority of all messages with let's say "Vitor" in the payload to Priority 9, regardless of what the app coded or the queue's Default Priority value is.


Good point. As the OP appears to be the admin, you'd expect that to be mentioned.

But expectations are often dashed.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ Java / JMSMQ priority in Explorer for JMS application
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.