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 function in Message Broker 7

Post new topic  Reply to topic Goto page 1, 2  Next
 SLEEP function in Message Broker 7 « View previous topic :: View next topic » 
Author Message
alewis
PostPosted: Fri Jul 30, 2010 11:56 am    Post subject: SLEEP function in Message Broker 7 Reply with quote

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
View user's profile Send private message
Gaya3
PostPosted: Fri Jul 30, 2010 12:19 pm    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

Extract from Infocenter
http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/bb45000_.htm

SLEEP function
The SLEEP function delays the execution of a message flow instance for a defined period of time, and returns a Boolean value to indicate whether or not the sleep completed without interruption.

It is a recommended way

Look at this Thread
http://www.mqseries.net/phpBB/viewtopic.php?p=203532&sid=4d71fb11592f1a6b9f956a261318f187

Call ESQL function from Java


i havent come across the sleep method in java yet.
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jul 30, 2010 1:45 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Gaya3
PostPosted: Tue Aug 03, 2010 5:45 am    Post subject: Reply with quote

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
View user's profile Send private message
alewis
PostPosted: Tue Aug 03, 2010 10:20 am    Post subject: Reply with quote

Novice

Joined: 20 Aug 2006
Posts: 13

Well if the thread is not released after calling the SLEEP function, I would stop the flow using the timer node as described in http://www.ibm.com/developerworks/websphere/library/techarticles/0603_schutz/0603_schutz.html and have used the same strategy in version 6
Back to top
View user's profile Send private message
mgk
PostPosted: Fri Oct 29, 2010 10:37 am    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Fri Dec 10, 2010 12:38 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Does it terminate if the broker or EG is stopped?
Back to top
View user's profile Send private message
mgk
PostPosted: Fri Dec 10, 2010 2:21 am    Post subject: Reply with quote

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
View user's profile Send private message
veeru_hyd
PostPosted: Sun Dec 12, 2010 11:57 pm    Post subject: Trying to use sleep90 function in WMB7.0 Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Mon Dec 13, 2010 12:20 am    Post subject: Re: Trying to use sleep90 function in WMB7.0 Reply with quote

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
View user's profile Send private message
veeru_hyd
PostPosted: Mon Dec 13, 2010 1:27 am    Post subject: Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Mon Dec 13, 2010 2:29 am    Post subject: Reply with quote

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
View user's profile Send private message
harish_td
PostPosted: Mon Dec 13, 2010 2:34 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
veeru_hyd
PostPosted: Mon Dec 13, 2010 2:51 am    Post subject: Reply with quote

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
View user's profile Send private message
mgk
PostPosted: Mon Dec 13, 2010 2:54 am    Post subject: Reply with quote

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
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 » SLEEP function in Message Broker 7
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.