Author |
Message
|
KeeferG |
Posted: Wed Nov 17, 2004 6:13 am Post subject: Best place for the sending application to pass instance data |
|
|
 Master
Joined: 15 Oct 2004 Posts: 215 Location: Basingstoke, UK
|
We are about to create an application with approx 100 threads putting to a queue. We want to have a way of putting data into the MD saying what thread it is so the the getting application can get messages by thread as it too will have approx 100 threads in a 1-1 mapping. We are contemplating setting a thread ID in the messageID or correlationID. Would this be the right place for it or is somewhere else better. We are not expecting back any replies so those fields are not being used.
Anyone have any views on this _________________ Keith Guttridge
-----------------
Using MQ since 1995 |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Nov 17, 2004 7:09 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I'm not sure your design makes much sense.
That said, you could add an RFH header (preferably an MQRFH2). This is usually the best place to put application specific data, as it's a) a standard header with room for application data and b) very flexible in the amount of data it can hold and return. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
KeeferG |
Posted: Wed Nov 17, 2004 7:25 am Post subject: |
|
|
 Master
Joined: 15 Oct 2004 Posts: 215 Location: Basingstoke, UK
|
I agree with you on the design but the application already exist and we are adding a log/trace facility for each machine on the network reporting back to a single log/trace machine. Each machine will have its own queue on the log/trace machin and that wants to remove the messages by putting thread as each thread needs its own log file. The RFH2 would be what i would use if i didnt need to get them off the queue by thread.
May have a chat with the app guys to review the way their log/trace writer will work.
Cheers _________________ Keith Guttridge
-----------------
Using MQ since 1995 |
|
Back to top |
|
 |
RogerLacroix |
Posted: Wed Nov 17, 2004 9:12 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Sometimes brute force is the simplest and cleanest solution.
Define a queue for each thread. 100 threads hence 100 queues (i.e. 'ABC.T###.Q' where ### is the thread number) and you can use the ApplIdentityData field to pass data between the sending and the receiving applications (field size is 32 bytes).
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
kirani |
Posted: Wed Nov 17, 2004 9:31 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Since you are planning on reading a specific message from the queue you cannot use MQRFH2 header. Storing the thread-id in MsgId or CorrelId column sounds good to me. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
KeeferG |
Posted: Wed Nov 17, 2004 9:38 am Post subject: |
|
|
 Master
Joined: 15 Oct 2004 Posts: 215 Location: Basingstoke, UK
|
That was the way they were originally thinking but that would have added nearly 1600 queues by the time it was done due to the number of machines being monitored and contingency queues.
I think I need to investigate the threading model of the receiving application and its need for serialisation a bit more. _________________ Keith Guttridge
-----------------
Using MQ since 1995 |
|
Back to top |
|
 |
|