|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MsgId as a Primary Key |
« View previous topic :: View next topic » |
Author |
Message
|
mangel1976 |
Posted: Wed Jan 31, 2007 4:23 am Post subject: MsgId as a Primary Key |
|
|
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 |
|
 |
jefflowrey |
Posted: Wed Jan 31, 2007 4:27 am Post subject: |
|
|
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 |
|
 |
mangel1976 |
Posted: Wed Jan 31, 2007 9:04 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Wed Jan 31, 2007 9:47 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
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
|
|
|
|