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 » WebSphere Message Broker (ACE) Support » MsgId as a Primary Key

Post new topic  Reply to topic
 MsgId as a Primary Key « View previous topic :: View next topic » 
Author Message
mangel1976
PostPosted: Wed Jan 31, 2007 4:23 am    Post subject: MsgId as a Primary Key Reply with quote

Newbie

Joined: 31 Jan 2007
Posts: 2

Hi everybody, Im trying to save messages sended by an application so they can be use to reply ,like 5 days later or more, with some fields changed. When the replier send the reply i will use the original msgid to restore the message from the DB. Is it advisable to use the MsgId as a Primary key of table of messages? will it be unique during the period i mention or not?

Thanks,
Mangel
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Jan 31, 2007 4:27 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Message Ids that were generated by a queue manager will be globally unique over a very long period of time. Assuming you only have one queue manager with the same name in the same network.

Message Ids generated by some Java programmer who thought it would be cool to use it to help him filter messages off a queue so he could share a queue between several entirely different logical functions... These message ids, on the other hand, are guaranteed to be the same all the time.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
mangel1976
PostPosted: Wed Jan 31, 2007 9:04 am    Post subject: Reply with quote

Newbie

Joined: 31 Jan 2007
Posts: 2

jefflowrey, in this case the application will put the message in the queue and the QM generates the msgid. The question is it better to use msgid as primary key or other key generated in the flow or a timestamp.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Jan 31, 2007 9:47 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

It's perfectly reasonable to use an MQ generated MsgId as a database key.

You probably want to augment the table with some business level identifiers, as well - if any human is ever going to try and look at the table.

I can't say if it's BETTER to do one or another, though. I don't know what you think of as "better".
_________________
I am *not* the model of the modern major general.
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 » WebSphere Message Broker (ACE) Support » MsgId as a Primary Key
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.