Author |
Message
|
Glass |
Posted: Thu Nov 16, 2006 1:04 pm Post subject: Changing the Default Priority of a Message |
|
|
Acolyte
Joined: 02 Mar 2006 Posts: 56
|
Hi,
I am using MQ Integrator version 2.1 and I wanted to change the message priority depending on a certain condition. I tried adding the code in ESQL as:
SET OutputRoot.MQMD.Priority=2;
In mqsi trace I see that it gets set to 2 but when the message appears in the queue, the value is '0'. In the queue properties, I have the "Message Delivery Sequence" set as "Priority".
I also tried setting the "Default Priority" of the queue to 2 and still all the messages passing through it has a priotity of 0.
What am I missing here or what is the best way to set the message priority?
Thanks! |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu Nov 16, 2006 1:17 pm Post subject: Re: Changing the Default Priority of a Message |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi Glass,
Instead of this
Glass wrote: |
SET OutputRoot.MQMD.Priority=2; |
try this
Code: |
SET OutputRoot.Properties.Priority=2 |
Should work...
Regards. |
|
Back to top |
|
 |
Glass |
Posted: Thu Nov 16, 2006 1:31 pm Post subject: |
|
|
Acolyte
Joined: 02 Mar 2006 Posts: 56
|
Elvis,
This did not change anything. Is there a way to change the priority of all messages passing throgh a particular queue by changing the properties of that queue directly without making ESQL changes?
Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Fri Nov 17, 2006 12:07 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Hi Glass,
I'm using MQSI 2.1 (no-one say anything - the upgrade being planned!) and I have flows at the moment using
Code: |
OutputRoot.MQMD.Priority= ... |
and this is working fine.
Obvious question time - how are you checking the priority of the outbound message? Is there a QALIAS in use? Can anything else be interfering with the setting.
Certainly if you don't code anything, changing the priority of the queue should have an effect...
...odd. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Glass |
Posted: Fri Nov 17, 2006 9:56 am Post subject: |
|
|
Acolyte
Joined: 02 Mar 2006 Posts: 56
|
I found out that in MQ Series 5.3, which we have, you cannot change the priority directly in the queue. Well, you can but it will have no effect.
When I change the code in ESQL I am checking the priority in the message in the queue by stopping the sender channel. I don't hav any QALIAS.
Thanks for your input. I will keep trying. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 20, 2006 12:59 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Glass wrote: |
I found out that in MQ Series 5.3, which we have, you cannot change the priority directly in the queue. Well, you can but it will have no effect. |
In all versions of MQ, you can only change the default priority in the queue attributes. Whatever puts the messages can still set it to a preferred value (subject to the limits obviously)
Glass wrote: |
When I change the code in ESQL I am checking the priority in the message in the queue by stopping the sender channel. I don't hav any QALIAS. |
Do you mean that, for development purposes only, you're stopping the sender channel to check the priority of the outbound message in the XMITQ? Because it's a bad thing to stop a sender channel for any other reason.
I'd also be inclined to check the priority of the message once it arrives at it's destination. Not only is it easier (!) it's the answer the recieving app will be required to use and therefore a better representation.
You could of course use a QALIAS (with a different default priority) to set the priority of your messages, but that's a very big sladehammer to crack a very small nut. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
zpat |
Posted: Mon Nov 20, 2006 1:09 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
[quote="Vitor]You could of course use a QALIAS (with a different default priority) to set the priority of your messages, but that's a very big sladehammer to crack a very small nut.[/quote]
That sounds like something Noddy Holder would use...  |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 20, 2006 1:21 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
zpat wrote: |
[quote="Vitor]You could of course use a QALIAS (with a different default priority) to set the priority of your messages, but that's a very big sladehammer to crack a very small nut. |
That sounds like something Noddy Holder would use... [/quote]
Possibly, but you'd feel the noise....
Time to climb down off the platforms and get more coffee. Much, much more coffee.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
nathanw |
Posted: Mon Nov 20, 2006 2:09 am Post subject: |
|
|
 Knight
Joined: 14 Jul 2004 Posts: 550
|
Why not set the priority in the message when it is originally written to MQ and then pass the MQMD parameters across in Broker
In essence if you cannot change the priority in Broker then you have a problem in your code or a setting somewhere after the esql to regenerate your header information and ignore previous settings. _________________ Who is General Failure and why is he reading my hard drive?
Artificial Intelligence stands no chance against Natural Stupidity.
Only the User Trace Speaks The Truth  |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 20, 2006 2:15 am Post subject: Re: Changing the Default Priority of a Message |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
nathanw wrote: |
Why not set the priority in the message when it is originally written to MQ and then pass the MQMD parameters across in Broker |
Glass wrote: |
I wanted to change the message priority depending on a certain condition. |
_________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
nathanw |
Posted: Mon Nov 20, 2006 2:18 am Post subject: Re: Changing the Default Priority of a Message |
|
|
 Knight
Joined: 14 Jul 2004 Posts: 550
|
Vitor wrote: |
nathanw wrote: |
Why not set the priority in the message when it is originally written to MQ and then pass the MQMD parameters across in Broker |
Glass wrote: |
I wanted to change the message priority depending on a certain condition. |
|
I agree about the condition but wouldnt the condition apply at source? In other words depending on the condition write the original message with teh correct priority _________________ Who is General Failure and why is he reading my hard drive?
Artificial Intelligence stands no chance against Natural Stupidity.
Only the User Trace Speaks The Truth  |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 20, 2006 2:29 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Not necessarially; consider the example of an ordering system. Orders are received from a variety of sources, perhaps some from 3rd parties, some from direct sales (e.g. web). For business reasons these need to be prioritised by sale type and/or channel with a database used to hold scoring values. Rather than having 1-n connections & applications to the database, especially from areas vunerable to change & attack, you might well concentrate the functionality in the message broker. This also allows easier monitoring and scaling, and simplifies changes to database schema by having only 1 application referencing it!
Not compelling reasons to be sure and there are equally valid examples where you'd set priority on send. As I intimated further up the thread, we set priority in the broker like we set destination. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
nathanw |
Posted: Mon Nov 20, 2006 2:39 am Post subject: |
|
|
 Knight
Joined: 14 Jul 2004 Posts: 550
|
Vitor yes you are right and like you normally I set priority etc in broker based on conditions therein, however, in this case it seems like he cannot.
I have to admit that stopping and starting a sender channel to check settings seems very harsh tho. _________________ Who is General Failure and why is he reading my hard drive?
Artificial Intelligence stands no chance against Natural Stupidity.
Only the User Trace Speaks The Truth  |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 20, 2006 2:43 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
nathanw wrote: |
in this case it seems like he cannot.
|
It would be a shame to incur all the overhead for setting priority at source (via QALIAS etc) when the functionality exists with broker to do it as he wishes; we know it exists because both of us are using it!
Extending the same arguement ad absurdium would have us using HTTP if we can't get channels to start! Besides, fixing problems is fun....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
nathanw |
Posted: Mon Nov 20, 2006 3:06 am Post subject: |
|
|
 Knight
Joined: 14 Jul 2004 Posts: 550
|
I agree
As for fixing the problem,a s far as I can see it is either his code or there is a setting after the compute node to create new parameters etc. thus erasing his priority _________________ Who is General Failure and why is he reading my hard drive?
Artificial Intelligence stands no chance against Natural Stupidity.
Only the User Trace Speaks The Truth  |
|
Back to top |
|
 |
|