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 Previous  1, 2
 MQPut failure for same CorrelaionID « View previous topic :: View next topic » 
Author Message
Vitor
PostPosted: Fri Apr 17, 2009 6:03 am    Post subject: Reply with quote

Grand High Poobah

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

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


Not if you're putting or publishing to a remote queue. And CorrelId shouldn't contain business data either.

Especially in pub/sub where IIRC it's used by the system.
_________________
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 6:13 am    Post subject: Reply with quote

Chevalier

Joined: 05 Nov 2005
Posts: 401

Quote:
Not if you're putting or publishing to a remote queue


Well obviously the Get will be local (I can do that no problem).

Quote:
And CorrelId shouldn't contain business data either


Why not ! What if I was doing insurance quotes and I wanted to use [say] the policy number as a way of correlating messages. Why wouldn't I use that (obviously formatted to be a valid value for MQ) ? Whatever the value used for correlation purposes, its just a token right ?

Quote:
Especially in pub/sub where IIRC it's used by the system.


The check for duplicates happens BEFORE publication, and publication should ONLY occur for NON duplicate.

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

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

goffinf wrote:
Why not ! What if I was doing insurance quotes and I wanted to use [say] the policy number as a way of correlating messages. Why wouldn't I use that (obviously formatted to be a valid value for MQ) ? Whatever the value used for correlation purposes, its just a token right ?


Oh dear...I have just definitely had my vu deja'd!
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
goffinf
PostPosted: Fri Apr 17, 2009 7:09 am    Post subject: Reply with quote

Chevalier

Joined: 05 Nov 2005
Posts: 401

Quote:
Oh dear...I have just definitely had my vu deja'd!


You're talking in riddles. Can you give me a rational explanation why I shouldn't use CorrelID as an accessor value for a message, and why I shouldn't put a value that I can easily derive from business data in there.

Sure I could let MQ create me the value and pass it back to the requestor and say 'hey .. any time you talk to me in the future, pass me this value', but thats not the situation I'm in and in any event I don't see any real difference between MQ creating the value and doing it myself (I can apply as much uniqueness to it as I need).

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

Grand Master

Joined: 25 Jun 2008
Posts: 17447

goffinf wrote:
You're talking in riddles. Can you give me a rational explanation why I shouldn't use CorrelID as an accessor value for a message, and why I shouldn't put a value that I can easily derive from business data in there.


A CorrelationID is not a string. A CorrleationID is not a number. A correlation ID is always 24 bytes long.

Your business data is almost never going to meet that criteria. Putting business data in CorrelId and MsgId is a long established WORST practice that has shown over and over and over again to cause unexpected problems in the middle of the night during a busy production cutover window that are unfixable for three months until the next development cycle completes.
Back to top
View user's profile Send private message
exerk
PostPosted: Fri Apr 17, 2009 7:17 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

Thank you mqjeff - I would not have been that erudite.
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Apr 17, 2009 7:33 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

All of that said, and hopefully well received...

For the purpose of the solution at hand, using a queue that held messages with JUST the actual business data field in them, and some kind of generated/calculated hash key from the business data field in the correlId is a reasonable approach, as long as a lot of care is taken to ensure that the correlID field that is generated and is "safe".
Back to top
View user's profile Send private message
goffinf
PostPosted: Fri Apr 17, 2009 8:57 am    Post subject: Reply with quote

Chevalier

Joined: 05 Nov 2005
Posts: 401

Quote:
All of that said, and hopefully well received...


Of course.

Quote:
A CorrelationID is not a string. A CorrleationID is not a number. A correlation ID is always 24 bytes long.


Yes, I'm well aware of that, but thats not really a problem.

Quote:
and some kind of generated/calculated hash key from the business data field in the correlId is a reasonable approach


Indeed, that is exactly what I meant by :-

Quote:
(obviously formatted to be a valid value for MQ)


from one of my earlier responses.

We have done this a few times, that is, take a piece of BUSINESS DATA that is present and consistent in all the messages exchanged (and has been validated) and (carefully) create a 24 byte hash, and use that as the correlation id. I've never had a problem with it thus far, thats why I was surprised to see such a backlash. As I said, at the end of the day its just a 24 byte 'token' that an application can straight-forwardly reproduce from data that it has available.

So, it seems that I have at least one potential solution, albeit admittedly not ideal.

Fraser.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Apr 17, 2009 11:50 pm    Post subject: Reply with quote

Grand High Poobah

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

Quote:
The check for duplicates happens BEFORE publication, and publication should ONLY occur for NON duplicate.

Fraser.

Still not getting it. I am surprised that Jeff did not point it out either.
Pub/Sub uses the correlationId field for its own purpose. If you want to pass your own data don't use the correlationId field use a user property on the RFH2 to store it. Beware of the fact that if you have to search for the property you should be using MQ V7 as in previous versions that search on the queue is going to be very expensive.... Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Sat Apr 18, 2009 10:36 am    Post subject: Reply with quote

Grand High Poobah

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

goffinf wrote:
I've never had a problem with it thus far


This day will come.

goffinf wrote:
I was surprised to see such a backlash.


I'm afraid this question has come up a lot.

goffinf wrote:
As I said, at the end of the day its just a 24 byte 'token' that an application can straight-forwardly reproduce from data that it has available.


Currently. I will say you have a far more sophisticated technique than most.

goffinf wrote:
So, it seems that I have at least one potential solution, albeit admittedly not ideal.


It's never ideal to set msgid or correlid, and is a cause of problems when you do. In the end you have to do what is best for you; we can just advise.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Apr 19, 2009 12:43 am    Post subject: Reply with quote

Grand High Poobah

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

goffinf wrote:
We have done this a few times, that is, take a piece of BUSINESS DATA that is present and consistent in all the messages exchanged (and has been validated) and (carefully) create a 24 byte hash, and use that as the correlation id. I've never had a problem with it thus far, thats why I was surprised to see such a backlash. As I said, at the end of the day its just a 24 byte 'token' that an application can straight-forwardly reproduce from data that it has available.


So did you ever use it in a pub/sub application? What was the result?
As I remember the pub/sub engine uses the correlationId field to distinguish between subscriptions at least in some cases. As such there is no reason for YOUR correlationId to be preserved on the message being served to the subscriber... as he is decoupled from the producer. If you require this field value to be received by the subscriber put it as a user defined property of the JMS message.

Caveat about searches on said property in version lower than V7. You might have to write a little app to remove this value and put it to the correlid field before your application consumes the message. Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Sun Apr 19, 2009 6:34 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I don't think that goffinf is actually talking about setting the correlid on the actual business message that is being published.

Just in (mis) using CorrelId to use a queue as a lookup table, instead of being forced to use an additional persistance mechanism. That is, it sounds like he's going to create a new, small, message that goes on an application-private queue, and just use that to find out if the current message SHOULD be published.

It seems like goffinf has the necessary skills and understanding to get away with this, sufficiently far beyond what the usual "why doesn't my correlationID get converted on the mainframe" kind of poster. So it's less likely to cause him (sorry, I'm pretty sure Frasier is a male name) to get woken up in the middle of the night because "MQ Lost my message".

But it doesn't remove the onus on the subscriber applications from having to deal with duplicated messages. Something is still going to slip through, somewhere sometime. So, sure, put in some additional validation and control at the middleware layer, but don't let the subscriber apps off the hook for their own necessary validation and data safety requirements.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 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.