|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Generating unique id |
« View previous topic :: View next topic » |
Author |
Message
|
bnewman18 |
Posted: Fri Mar 29, 2002 11:24 am Post subject: |
|
|
Newbie
Joined: 06 Mar 2002 Posts: 5
|
I would like to use MQSI to generate unique message ids as messages are received. This id will be used to track messages as they flow through mqsi and ensure message delivery. I would also like to generate id's as I save messages persistently in the database. Does anyone have any thoughts as to how to accomplish this using a database table for generating the id?
My thinking was to have a node which generates the Id by selecting from a table called maxid, incrementing the current value, and saving the new value. The problem is I'm not sure how MQSI will deal with the multiple threading that happens.
Anyone have additional thoughts on how to accomplish this or is the threading not a problem?
Thanks.
|
|
Back to top |
|
 |
kolban |
Posted: Fri Mar 29, 2002 12:17 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Have you considered using the UUIDASBLOB or UUIDASCHAR functions in WMQI 2.1? They generate universally unique identifiers within ESQL. |
|
Back to top |
|
 |
kirani |
Posted: Fri Mar 29, 2002 4:50 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
MQMD.MsgId is also a unique key if all the messages are generated by a single queue manager. You can also use this as a key field in your message flows.
|
|
Back to top |
|
 |
Tibor |
Posted: Sat Mar 30, 2002 1:51 am Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
when you connect to DB2, try this (or a similar)
Code: |
set OutputDestinationList.uuid_tmp[] = passthru('
select left(hex(generate_unique()),20) || hex(rand()) as UUID
from syscat.tables
fetch first 1 row only
optimize for 1 row');
set OutputDestinationList.uuid = OutputDestinationList.uuid_tmp.UUID;
set OutputDestinationList.uuid_tmp = NULL;
|
Kirani,
MsgId is unique, theoretically, but I saw same MsgIds in a queue...
|
|
Back to top |
|
 |
jfluitsm |
Posted: Sun Mar 31, 2002 2:24 am Post subject: |
|
|
Disciple
Joined: 24 Feb 2002 Posts: 160 Location: The Netherlands
|
Tibor,
MQSI copies the msgid from the input by default. So if you use 2 or more MQOutput nodes, these messages will have the same msgid.
Also, when the message is written from a program, and the MQMD is not set properly, all the messages will have the same msgid as the first.
_________________ Jan Fluitsma
IBM Certified Solution Designer WebSphere MQ V6
IBM Certified Solution Developer WebSphere Message Broker V6 |
|
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
|
|
|
|