Author |
Message
|
alewis |
Posted: Fri Jul 30, 2010 11:56 am Post subject: SLEEP function in Message Broker 7 |
|
|
Novice
Joined: 20 Aug 2006 Posts: 13
|
Hi,
For introducing a delay while processing a message in a message flow I had used the timer node in version 6 but in Broker 7, there is a Sleep ESQL function. Is this the recommended way to introduce a delay in a message flow now as I could not find an equivalent Broker java API for it (not Thread.sleep() but something like getMessageFlow().sleep()) |
|
Back to top |
|
 |
Gaya3 |
Posted: Fri Jul 30, 2010 12:19 pm Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jul 30, 2010 1:45 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Gaya3 wrote: |
I haven't come across the sleep method in java yet. |
I thought you'd come across
Code: |
long mysleep = 1000l; //in ms
Thread.currentThread().sleep(mysleep); |
Sleep has been available in Java forever... however it needs a catch block and can be interrupted...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Gaya3 |
Posted: Tue Aug 03, 2010 5:45 am Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
fjb_saper wrote: |
Gaya3 wrote: |
I haven't come across the sleep method in java yet. |
I thought you'd come across
Code: |
long mysleep = 1000l; //in ms
Thread.currentThread().sleep(mysleep); |
Sleep has been available in Java forever... however it needs a catch block and can be interrupted...  |
yes i do agree, but some time i feel like the thread [Message flow] is taking time to get paused. and i guess that is desired too.
internally i dont know how the ESQL SLEEP works, will it pause it the instance when we call it, or it will take time to pause [say for complete the transaction and pause it] _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
alewis |
Posted: Tue Aug 03, 2010 10:20 am Post subject: |
|
|
Novice
Joined: 20 Aug 2006 Posts: 13
|
|
Back to top |
|
 |
mgk |
Posted: Fri Oct 29, 2010 10:37 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
internally i dont know how the ESQL SLEEP works, will it pause it the instance when we call it, or it will take time to pause [say for complete the transaction and pause it] |
Sorry for the delay in replying, I missed this append before. The ESQL SLEEP will sleep immediately it is called for the specified duration. It is automatically interrupted if the flow is reconfigured... _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
zpat |
Posted: Fri Dec 10, 2010 12:38 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Does it terminate if the broker or EG is stopped? |
|
Back to top |
|
 |
mgk |
Posted: Fri Dec 10, 2010 2:21 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
Does it terminate if the broker or EG is stopped? |
Yes  _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
veeru_hyd |
Posted: Sun Dec 12, 2010 11:57 pm Post subject: Trying to use sleep90 function in WMB7.0 |
|
|
Novice
Joined: 28 Oct 2010 Posts: 23
|
Hi,
I am trying to use the sleep function in WMB 7.0 'SLEEP(1000);'. It is showing error. Do we need to install any adapter to get this function availabale in WMB 7.0?.
Thanks,
Veera |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Dec 13, 2010 12:20 am Post subject: Re: Trying to use sleep90 function in WMB7.0 |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
veeru_hyd wrote: |
Hi,
I am trying to use the sleep function in WMB 7.0 'SLEEP(1000);'. It is showing error. Do we need to install any adapter to get this function availabale in WMB 7.0?.
Thanks,
Veera |
According to the documentation,
Sleep is a FUNCTION that returns a BOOLEAN.
Are you calling it as a Function or a Procedure? _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
veeru_hyd |
Posted: Mon Dec 13, 2010 1:27 am Post subject: |
|
|
Novice
Joined: 28 Oct 2010 Posts: 23
|
I am calling it as a esql function in compute node. I tried to search it in help WMB 7.0. I did not find that. Finally i got this infocenter link from this thread. thats why I am suspecting that this may require a adaptor for using sleep function. Please help me out to make use of sleep().
Thanks,
Veera |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Dec 13, 2010 2:29 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Code: |
DECLARE bRes BOOLEAN;
SET bRes = SLEEP(1000);
|
Hmmm. That seems to be fine for me, at least as far as compiling the ESQL goes.
What have you tried? What are your exact errors? _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
harish_td |
Posted: Mon Dec 13, 2010 2:34 am Post subject: |
|
|
Master
Joined: 13 Feb 2006 Posts: 236
|
What version of the toolkit do you have?
Can you post the exact error that you are seeing? |
|
Back to top |
|
 |
veeru_hyd |
Posted: Mon Dec 13, 2010 2:51 am Post subject: |
|
|
Novice
Joined: 28 Oct 2010 Posts: 23
|
Hi,
I have used the same code. But it is showing error on 'SET bRes = SLEEP(1000);' statement.
I am using WMB 7.0 version. |
|
Back to top |
|
 |
mgk |
Posted: Mon Dec 13, 2010 2:54 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
I am using WMB 7.0 version. |
Well SLEEP was added in 7.0.0.1 so you need to upgrade to use it...
Kind regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
|