|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
unique messageID constraint |
« View previous topic :: View next topic » |
Author |
Message
|
bobjtowers |
Posted: Fri Aug 05, 2011 1:42 am Post subject: unique messageID constraint |
|
|
Newbie
Joined: 03 Aug 2011 Posts: 3
|
Hi there,
What i would like to do, is to have a constraint on a queue in which all messageIDs are unique... My goal is to eliminate duplicate messages.
I suspect that this constraint comes for free.. with some put options.. or some parameters on MQQueue or QMgr. I would rather use what's already available,.. rather than rolling my own.
I would be very grateful for any hints, tips or suggestions you may have to offer.
Have a lovely day.
bob  |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Aug 05, 2011 3:29 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
What you can do is have your application ask the queue manager to create the message id for each of your messages.
This is not remotely the same thing as putting a constraint on the queue to ensure that only messages with unique message ids (unique over what time frame, by the way?) can be placed on the queue.
But it probably does what you want.
And using the option on MQPUT to have the queue manager set the MQMD.MessageID is best practice, rather than having your application decide to create it's own idea of a "unique" id or even worse setting it to a business meaningful value. |
|
Back to top |
|
 |
bobjtowers |
Posted: Fri Aug 05, 2011 4:55 am Post subject: |
|
|
Newbie
Joined: 03 Aug 2011 Posts: 3
|
mqjeff wrote: |
What you can do is have your application ask the queue manager to create the message id for each of your messages.
This is not remotely the same thing as putting a constraint on the queue to ensure that only messages with unique message ids (unique over what time frame, by the way?) can be placed on the queue.
But it probably does what you want.
And using the option on MQPUT to have the queue manager set the MQMD.MessageID is best practice, rather than having your application decide to create it's own idea of a "unique" id or even worse setting it to a business meaningful value. |
Hi, thanks for your answer
If a message already has it's MessageID set to .. whatever value.. would this version of put over-write the existing value ?
Regs
Bob  |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Aug 05, 2011 4:58 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
It will do what the documentation says it does. |
|
Back to top |
|
 |
mvic |
Posted: Fri Aug 05, 2011 4:09 pm Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
bobjtowers wrote: |
If a message already has it's MessageID set to .. whatever value.. would this version of put over-write the existing value ? |
The application decides the msg id, or it decides to follow best practice by asking the qmgr to create a new msg id.
One or the other. The application decides.
If you have a need, as a qmgr administrator, to enforce best practice on your users' applications, you can force this in an MQPUT API exit.
Please search the manuals for MQPMO_NEW_MSG_ID, and/or the words: mqput api exit |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|