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 IBM MQ Support » MQPut failure for same CorrelaionID

Post new topic  Reply to topic Goto page 1, 2  Next
 MQPut failure for same CorrelaionID « View previous topic :: View next topic » 
Author Message
goffinf
PostPosted: Fri Apr 17, 2009 3:27 am    Post subject: MQPut failure for same CorrelaionID Reply with quote

Chevalier

Joined: 05 Nov 2005
Posts: 401

Is there any way to configure MQ to reject an MQPut for a message that has the same CorrelID (or MessageID ??) of one which already exists on a queue ??

Thanks

Fraser.
Back to top
View user's profile Send private message
JosephGramig
PostPosted: Fri Apr 17, 2009 3:58 am    Post subject: Reply with quote

Grand Master

Joined: 09 Feb 2006
Posts: 1244
Location: Gold Coast of Florida, USA

No
Back to top
View user's profile Send private message AIM Address
Vitor
PostPosted: Fri Apr 17, 2009 4:08 am    Post subject: Reply with quote

Grand High Poobah

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

If you're putting to a remote queue, the queue you're putting to could be empty by the time you put the next message.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
JosephGramig
PostPosted: Fri Apr 17, 2009 4:31 am    Post subject: Reply with quote

Grand Master

Joined: 09 Feb 2006
Posts: 1244
Location: Gold Coast of Florida, USA

And you might want to put several msgs to the same queue with the same correlation ID because they're correlated.
Back to top
View user's profile Send private message AIM Address
kevinf2349
PostPosted: Fri Apr 17, 2009 4:55 am    Post subject: Reply with quote

Grand Master

Joined: 28 Feb 2003
Posts: 1311
Location: USA

Anyone else getting a bad (but familiar) feeling about where this is going?
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Apr 17, 2009 4:57 am    Post subject: Reply with quote

Grand High Poobah

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

kevinf2349 wrote:
Anyone else getting a bad (but familiar) feeling about where this is going?


My deja is vu'd all over the place.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
vol
PostPosted: Fri Apr 17, 2009 5:24 am    Post subject: Reply with quote

Acolyte

Joined: 01 Feb 2009
Posts: 69

There is no way to configure WMQ to reject a msg, but you can set it up so that all msgs have a unique CorrelId.

All the qmgrs in the network must have a unique name, and then ask the qmgr to allocate the CorrelId at the time the msg is put. All msgs in the system will have a unique CorrelId.
Back to top
View user's profile Send private message
goffinf
PostPosted: Fri Apr 17, 2009 5:28 am    Post subject: Reply with quote

Chevalier

Joined: 05 Nov 2005
Posts: 401

Ok guys cut me a little slack here, I'm (clearly) no MQ expert, thats why I'm posting !

Let me plainer. I want to PREVENT a message being written to a queue if there is already a message on that queue with the SAME ID (maybe MessageID is a better choice - thats why I'm asking). I am in control of what the 'id' value is, its based on business content from messages being received elsewhere and I set it before attempting the Put.

In one sense you can view this as a mechanism for detecting duplicate messages.

Any ideas

Fraser.
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Fri Apr 17, 2009 5:29 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

vol, dont you mean message id rather than correl id?
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Fri Apr 17, 2009 5:34 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

goffinf wrote:

Let me plainer. I want to PREVENT a message being written to a queue if there is already a message on that queue with the SAME ID


There is nothing out of the box to do this as the first response to your question stated.

You will have to get your application to not put duplicates or filter them out somewhere.

Its also not a great idea to tinker with the msgid of a message.


Last edited by WMBDEV1 on Fri Apr 17, 2009 5:36 am; edited 1 time in total
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Apr 17, 2009 5:36 am    Post subject: Reply with quote

Grand High Poobah

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

goffinf wrote:
I am in control of what the 'id' value is, its based on business content from messages being received elsewhere and I set it before attempting the Put.

...

Any ideas


Yes - do not do this! (as everybody's deja vu fires)

There are many, many discussions on the forum on why a) you shouldn't set message id and b) you shouldn't (if you set it) put business data in it. This is a road that leads only to pain and misery. The search function will yield these.

If you want to do duplicate message avoidance, get the application coded to remove or ignore duplicates.

Do not set the message id yourself. It is a really bad idea.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Apr 17, 2009 5:39 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

goffinf wrote:
Ok guys cut me a little slack here, I'm (clearly) no MQ expert, thats why I'm posting !

Let me plainer. I want to PREVENT a message being written to a queue if there is already a message on that queue with the SAME ID (maybe MessageID is a better choice - thats why I'm asking). I am in control of what the 'id' value is, its based on business content from messages being received elsewhere and I set it before attempting the Put.

In one sense you can view this as a mechanism for detecting duplicate messages.

Any ideas

Fraser.


This is entirely wrong. Message IDs and CorrelationIDs should not contain business data. You should put this business data into MQv7 properties, if you feel that you must put it somewhere outside of the message body itself.

As others have said, there is no way you can tell MQ to refuse an MQPUT because of the contents of any header field nor even any MQ v7 property.

The detection of duplicate messages is best done and feasibly only done by the consuming application, not at the sending side.

Queues should not hold messages in general, they should be consumed at the same rate as they are put. So you shouldn't even expect that the original message will still be on the queue when you go to PUT it's duplicate.
Back to top
View user's profile Send private message
goffinf
PostPosted: Fri Apr 17, 2009 5:50 am    Post subject: Reply with quote

Chevalier

Joined: 05 Nov 2005
Posts: 401

OK guys, thanks for the advice it all makes good sense.

I agree it would be nice if the sending application wouldn't push out duplicates, but unfortunately I have no control over that (the messages arrrive via a published web service from many potential trading partner applications over the Internet).

As for the consuming application side, yes that is a possibility. However, this is part of a pub/sub application (the messages are business events) so it would mean implementing a duplicate detection solution in each and every subscriber application. For some this might be possible for others, it would push the bar too high.

Me, ... well I'm piggy in the middle(ware) so I was looking for a way of doing this cheaply and centrally without having to creating a bespoke durable and expiry enabled cache with a database of some other technology. Admittedly this is perhaps not the best use of MQ (and is possibly completely inappropriate) but ... budgets, delivery deadlines, ... you get the idea !

Thanks

Fraser.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Apr 17, 2009 5:53 am    Post subject: Reply with quote

Grand High Poobah

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

goffinf wrote:
Admittedly this is perhaps not the best use of MQ (and is possibly completely inappropriate)


At best it won't work. At worst it will break WMQ
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
goffinf
PostPosted: Fri Apr 17, 2009 5:58 am    Post subject: Reply with quote

Chevalier

Joined: 05 Nov 2005
Posts: 401

OK fair enough.

I guess I can do a non-destructive read using correlation id before the put and see if I get anything.

Thanks for your patience

Fraser.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » General IBM MQ Support » MQPut failure for same CorrelaionID
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.