|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
sleep flow |
« View previous topic :: View next topic » |
Author |
Message
|
antares |
Posted: Sun Oct 07, 2007 4:34 am Post subject: sleep flow |
|
|
Newbie
Joined: 06 Oct 2007 Posts: 3
|
Can I used Thread.sleep method to sleep flow? I want to use external java procedure call. Is it safe solution? Can it impact to other flows in execution group?
Example code
CREATE PROCEDURE sleep( IN value INTEGER)
LANGUAGE JAVA
EXTERNAL NAME "Sleeper.sleep";
public class Sleeper {
public static void sleep(Long value)
{
try
{
Thread.sleep(value.longValue());
}
catch (Exception e)
{
}
}
} |
|
Back to top |
|
 |
elvis_gn |
Posted: Sun Oct 07, 2007 4:46 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
|
Back to top |
|
 |
jefflowrey |
Posted: Sun Oct 07, 2007 6:33 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
To repeat myself from the last link that elvis_gn posted (nice searching, btw!)...
If you implement the code shown here, with sleep(), you could very easily interrupt the entire ExecutionGroup that your flow is deployed to.
The Timeout nodes are extremely flexible and should be able to handle almost any kind of delayed processing scheme. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
antares |
Posted: Sun Oct 07, 2007 6:36 am Post subject: |
|
|
Newbie
Joined: 06 Oct 2007 Posts: 3
|
I have simple flow like this:
MQINPUT -> HTTP Request.
I need to repeat HTTP Request if communication exception occure. Max count of repetitions is N. Time interval beetwen repetitions is M sec.
I think sleep is good and simple solution.
Backout threshold of input queue can be set on N. After an exception, process need to sleep for M sec and thats all. But my question is how makes sleep.
Regards |
|
Back to top |
|
 |
antares |
Posted: Sun Oct 07, 2007 6:58 am Post subject: |
|
|
Newbie
Joined: 06 Oct 2007 Posts: 3
|
jefflowrey wrote: |
If you implement the code shown here, with sleep(), you could very easily interrupt the entire ExecutionGroup that your flow is deployed to. |
Can you explain why it can interrupt other flows? Do diffrent flows in the same execution group use the same java thread? Is JCN better way?
jefflowrey wrote: |
The Timeout nodes are extremely flexible and should be able to handle almost any kind of delayed processing scheme. |
I find http://www.ibm.com/developerworks/websphere/library/techarticles/0601_cox/0601_cox.html
It is sophisticated solution and generate a lot of communication traffic.
In my opinion the best solution is blocking flow. |
|
Back to top |
|
 |
jefflowrey |
Posted: Sun Oct 07, 2007 7:44 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
antares wrote: |
jefflowrey wrote: |
If you implement the code shown here, with sleep(), you could very easily interrupt the entire ExecutionGroup that your flow is deployed to. |
Can you explain why it can interrupt other flows? Do diffrent flows in the same execution group use the same java thread? Is JCN better way? |
Why would a JCN be any different? It's the same interface, the same java, the same JVM. Every EG is it's own JVM.
Every time a message flow starts, it is given a thread from the pool of threads that the EG maintains. If you sit and block on that thread, then a) that thread is not available for reuse by other flows (and you could run out), and b) you run the risk of blocking the EG because it's waiting for your thread to return.
That flow generates only one additional MQ message for each invocation, between the timeout control node and the timeout notification node.
With a flow like you've got, putting that subflow in will produce an almost minimal impact on the processing speed of your flow.
Of course, any such concerns about "communication traffic" and "performance" are only meaningful in the context of a measurable environment, with specific criteria that can be evaluated against performance measurements.
Also, if you trusted your opinion, you wouldn't be asking. _________________ 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
|
|
|
|