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 » unique messageID constraint

Post new topic  Reply to topic
 unique messageID constraint « View previous topic :: View next topic » 
Author Message
bobjtowers
PostPosted: Fri Aug 05, 2011 1:42 am    Post subject: unique messageID constraint Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Fri Aug 05, 2011 3:29 am    Post subject: Reply with quote

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
View user's profile Send private message
bobjtowers
PostPosted: Fri Aug 05, 2011 4:55 am    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Fri Aug 05, 2011 4:58 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

It will do what the documentation says it does.
Back to top
View user's profile Send private message
mvic
PostPosted: Fri Aug 05, 2011 4:09 pm    Post subject: Reply with quote

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
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 » unique messageID constraint
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.