Author |
Message
|
JYama |
Posted: Thu Aug 23, 2007 6:42 pm Post subject: Can I get the processId of a message flow? |
|
|
 Master
Joined: 27 Mar 2002 Posts: 281
|
Hi experts,
I'd like to know about a way to retrieve the threadId of a message flow.
How can I code this in ESQL?
Is there anybody who experienced this?
I'm using WMBv6 on AIX, BTW.
Many thanks in advance, |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu Aug 23, 2007 9:47 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
|
Back to top |
|
 |
JYama |
Posted: Thu Aug 23, 2007 9:55 pm Post subject: |
|
|
 Master
Joined: 27 Mar 2002 Posts: 281
|
Thank you for your help.
I learned a way to retrieve the processId of a broker, thank you for that, but I also want to know the threadId of a message flow.
Is it accessible in ESQL?
Do you know something on this? |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu Aug 23, 2007 10:02 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi JYama,
That link was to say that it's not listed and hence most probably not available
Can we know your requirement, perhaps we will have a workaround...
Regards. |
|
Back to top |
|
 |
JYama |
Posted: Thu Aug 23, 2007 10:18 pm Post subject: |
|
|
 Master
Joined: 27 Mar 2002 Posts: 281
|
elvis_gn wrote: |
Can we know your requirement, perhaps we will have a workaround...
|
Well, I want to exchange the threadId between message flows.
For example, let's say there are two message flows.
The 1st flow is invoked by an MQ message input and it passes on the output message processed to the 2nd flow.
I want to transfer the threadId of the 1st flow to the 2nd flow via a local queue.  |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu Aug 23, 2007 11:08 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi JYama,
You could use flow names to relate the flows, but then you might have additional instances, so it won't work.
The threadId is not available so that's out of the question I guess.
Sorry, run out of ideas
Regards. |
|
Back to top |
|
 |
JYama |
Posted: Thu Aug 23, 2007 11:12 pm Post subject: |
|
|
 Master
Joined: 27 Mar 2002 Posts: 281
|
Well,,,, ,,, I know threadIds are only available in the UserTrace,,, so I guess there should be a way to retrieve the number...
Anyway, thank you for your help and I appreciate it.  |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Aug 24, 2007 5:57 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
JYama wrote: |
elvis_gn wrote: |
Can we know your requirement, perhaps we will have a workaround...
|
Well, I want to exchange the threadId between message flows.
For example, let's say there are two message flows.
The 1st flow is invoked by an MQ message input and it passes on the output message processed to the 2nd flow.
I want to transfer the threadId of the 1st flow to the 2nd flow via a local queue.  |
You are still talking about a solution here not a requirement!
What is the reason you would like to transfer the threadid?
I am thinking here threadId, execution context => message affinity?? _________________ MQ & Broker admin |
|
Back to top |
|
 |
JYama |
Posted: Fri Aug 24, 2007 7:05 am Post subject: |
|
|
 Master
Joined: 27 Mar 2002 Posts: 281
|
Quote: |
What is the reason you would like to transfer the threadid? |
Just to relate various and nested syslog outputs based on business scenarios. 
Last edited by JYama on Fri Aug 24, 2007 7:17 am; edited 1 time in total |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Aug 24, 2007 7:16 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Have you looked at Broker User Exits? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
JYama |
Posted: Fri Aug 24, 2007 7:28 am Post subject: |
|
|
 Master
Joined: 27 Mar 2002 Posts: 281
|
jefflowrey wrote: |
Have you looked at Broker User Exits? |
No, I haven't.
I wanted to achieve it with just basic functions within ESQL but coding an user exit is too much so I'll give up this.
Thanks, |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Aug 24, 2007 8:24 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can get threadID from java.
It might work to call a java static procedure from ESQL to get the threadID that esql is running. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Aug 24, 2007 8:43 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
jefflowrey wrote: |
You can get threadID from java.
It might work to call a java static procedure from ESQL to get the threadID that esql is running. |
Jeff,
Wouldn't this rather give the threadId within the JVM that is executing the java static procedure ??
How far up to the parent thread would you need to go? _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Aug 24, 2007 8:52 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You're probably right. I've never tried it.
I've never seen much value in keeping track of which thread id or process id or etc. a given message flow is running in.
I've always been more interested in what happens to each individual message, rather than in what happens in each individual flow instance. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Aug 24, 2007 1:54 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
And if you need to, you could use a local and shared counter.
If the local counter (local to the flow instance (Environment.*) is not set increment the shared one in an ATOMIC way and make the local one be that result. Now if you prefix each of your outputs by the value of the counter and flow name, you would have a reliable correlation... within the same execution group/flow...
Another one might be to assign each instance of the flow a unique variable...
However this is only guaranteed if the eg never stops an instance if it is no longer needed. Otherwise you would have to allow for a bigger max value than the max number of instances...
If the value is not important in itself (correlation happens by machine) you could as well use a GUIID.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|