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 » sleep flow

Post new topic  Reply to topic
 sleep flow « View previous topic :: View next topic » 
Author Message
antares
PostPosted: Sun Oct 07, 2007 4:34 am    Post subject: sleep flow Reply with quote

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
View user's profile Send private message
elvis_gn
PostPosted: Sun Oct 07, 2007 4:46 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi antares,
Please try a search next time before posting....this has been discussed many a times, here are a few links
http://www.mqseries.net/phpBB2/viewtopic.php?t=38821
http://www.mqseries.net/phpBB2/viewtopic.php?t=38697
http://www.mqseries.net/phpBB2/viewtopic.php?t=34428

If your business requirements are not covered in the above or the other related posts, then please paste your requirement...but I hope you've got the suggestion that a sleep is not a good idea.

Regards.
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Sun Oct 07, 2007 6:33 am    Post subject: Reply with quote

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
View user's profile Send private message
antares
PostPosted: Sun Oct 07, 2007 6:36 am    Post subject: Reply with quote

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
View user's profile Send private message
antares
PostPosted: Sun Oct 07, 2007 6:58 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Sun Oct 07, 2007 7:44 am    Post subject: Reply with quote

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.

antares wrote:
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.


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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » sleep flow
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.