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 » how many message flow instance is running currently.

Post new topic  Reply to topic Goto page 1, 2  Next
 how many message flow instance is running currently. « View previous topic :: View next topic » 
Author Message
lcl3977
PostPosted: Fri May 07, 2010 12:25 am    Post subject: how many message flow instance is running currently. Reply with quote

Apprentice

Joined: 04 Jul 2006
Posts: 27

hi all,
As we know, we can configure the message flow addtional instance in the bar file.
then we deploy it to the execute group.
can I get the number of the running instance of this message flow currently?
is there some command or function in esql can do that?
thanks.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri May 07, 2010 2:27 am    Post subject: Re: how many message flow instance is running currently. Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20697
Location: LI,NY

lcl3977 wrote:
hi all,
As we know, we can configure the message flow addtional instance in the bar file.
then we deploy it to the execute group.
can I get the number of the running instance of this message flow currently?
is there some command or function in esql can do that?
thanks.

The flowstats should tell you.
Alternatively and if nothing else has the queue open for input you could look at the queue's input count.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Esa
PostPosted: Fri May 07, 2010 4:15 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

Hello lcl3977,

If I understood correctly, you would like to know the number of currently running threads so that you could adjust the behavior of your flow in runtime?

As far as I know there is no way to get that information from the broker. You will have to implement a counter yourself. I would do it this way:

1. Create a singleton java class for maintaining a thread counter. You will also have to synchronize the (static) methods that update the counter.

2. Add a java compute node in the beginning of the flow. In the evaluate method do like this:

Code:

try {
  - increment the thread counter
  - propagate the message
} finally {
  - decrement the thread counter
}


Now, in the actual flow, you can access the counter and get the number of currently running threads.

Of course the counter does not always tell the precise number of threads. Threads that have caught an exception and are still processing the catch path are not counted in. Well, you can put the same JCN in the beginning of the catch path as well. There is no way to know if there are threads that are currently processing messages in the input node, but you will get a good enough approximation, I think.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri May 07, 2010 4:37 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Please do not make any use of this information in your message flow logic.

You will entirely tie yourself in knots and end up with a confused and unmaintainable solution.

Please explain the business requirement you are attempting to meet with this technical question.
Back to top
View user's profile Send private message
Esa
PostPosted: Fri May 07, 2010 5:00 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

mqjeff wrote:
Please do not make any use of this information in your message flow logic.

You will entirely tie yourself in knots and end up with a confused and unmaintainable solution.


Yes, writing a flow that depends on knowing the number of currently running threads does not sound like a good idea. But I think this person is planning to put the information in an exception message...

But that won't tie anybody in knots and make them end up with a confused and unmaintainable solution. Unless you mean my way of using java will do it, which I hope you don't.

Best Regards,

Esa
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri May 07, 2010 5:27 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Esa wrote:
mqjeff wrote:
Please do not make any use of this information in your message flow logic.

You will entirely tie yourself in knots and end up with a confused and unmaintainable solution.


Yes, writing a flow that depends on knowing the number of currently running threads does not sound like a good idea. But I think this person is planning to put the information in an exception message....

There's nothing to indicate that from here. Perhaps you know otherwise.

Esa wrote:
But that won't tie anybody in knots and make them end up with a confused and unmaintainable solution. Unless you mean my way of using java will do it, which I hope you don't.


No, doing it with a Java singleton is fine. But doing it in general is not a great idea.
Back to top
View user's profile Send private message
Esa
PostPosted: Fri May 07, 2010 5:52 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

mqjeff wrote:

There's nothing to indicate that from here. Perhaps you know otherwise.


No, I'm just guessing. The only reason i can think why anyone would like to do this is to try to track if certain exceptions only happen when there are several instances running simultaneously.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri May 07, 2010 6:12 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20697
Location: LI,NY

Esa wrote:
mqjeff wrote:

There's nothing to indicate that from here. Perhaps you know otherwise.


No, I'm just guessing. The only reason i can think why anyone would like to do this is to try to track if certain exceptions only happen when there are several instances running simultaneously.

If that were the case it would point to a design error for not taking into account concurrency problems, would it not?
This should be relatively easy to spot without having to go counting the flow instances while in error handling...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Esa
PostPosted: Fri May 07, 2010 10:53 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

Yes, if it is about a design problem. Could be something else, too. A problem with some external resource. Or a way for the developers to prove that there is nothing wrong with the design but the production environment is not correctly configured

lcl3977 has not come back so we cannot know why he wanted to know this or if this was what he wanted to know. Maybe he just wanted to know the number of the current thread...
Back to top
View user's profile Send private message
lcl3977
PostPosted: Tue May 11, 2010 12:54 am    Post subject: Reply with quote

Apprentice

Joined: 04 Jul 2006
Posts: 27

thank all for your reply.
let me tell you about our program and problem.

my message flow has two ways input,the http input and mq input node.
when a lot of request come in,and the message flow process the message is too slow(because other system give response to my message flow is too slow).
and then the http request will time out.

the message flow instance is 200,and in that time,I find the http connect is about 150,
so I want to know how many instance is running that time.
Back to top
View user's profile Send private message
lcl3977
PostPosted: Tue May 11, 2010 1:02 am    Post subject: Re: how many message flow instance is running currently. Reply with quote

Apprentice

Joined: 04 Jul 2006
Posts: 27

fjb_saper wrote:

Alternatively and if nothing else has the queue open for input you could look at the queue's input count.



in my message flow there is not only mq input node but also http input node.
and I have done a test, when the message flow don't process the message,the queue's input count does not decrease.

thank you for your reply.
Back to top
View user's profile Send private message
fatherjack
PostPosted: Tue May 11, 2010 1:05 am    Post subject: Reply with quote

Knight

Joined: 14 Apr 2010
Posts: 522
Location: Craggy Island

lcl3977 wrote:
so I want to know how many instance is running that time.


Do you mean how many instances are running because that will be whatever you specified when you deployed won't it? Or do you mean how many are actively processing a message at any given time?
_________________
Never let the facts get in the way of a good theory.
Back to top
View user's profile Send private message
lcl3977
PostPosted: Tue May 11, 2010 1:14 am    Post subject: Reply with quote

Apprentice

Joined: 04 Jul 2006
Posts: 27

fatherjack wrote:
lcl3977 wrote:
so I want to know how many instance is running that time.


Do you mean how many instances are running because that will be whatever you specified when you deployed won't it? Or do you mean how many are actively processing a message at any given time?


I want to know how many instances are actively processing message at any given time.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue May 11, 2010 2:10 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You can get this information from the Broker administrative tooling - the CMP API, the Toolkit, the Broker Explorer and etc.

YOU DO NOT WANT TO USE THIS INFORMATION IN YOUR FLOW.

Broker 6.1 and later will let you determine the specific number of additional instances that a given node can have - not just the entire flow. This will allow you to configure the HTTPInput node to have 200 threads (for example) and the MQInput node to have 200 threads, independently of each other. If you just put the additional instances of the flow to 400, then either input node could use all threads and leave the other one without any.
Back to top
View user's profile Send private message
fatherjack
PostPosted: Tue May 11, 2010 2:52 am    Post subject: Reply with quote

Knight

Joined: 14 Apr 2010
Posts: 522
Location: Craggy Island

mqjeff wrote:
You can get this information from ..... the Toolkit


How?
_________________
Never let the facts get in the way of a good theory.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » how many message flow instance is running currently.
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.