Monday, December 8, 2008

Pausing Progress Sonic ESB Service

I recently needed a feature in Sonic ESB where the ESB Service needed to be paused for a period of time.

For the versions of ESB until v7.6, I could not pause the service and leave the messages in the entry point (queue in my case). In v7.6, which is the current version, the interface, XQLifeCycleManager, provides a start/stop functionality.

So, for the previous versions, in the service method, I paused the service before it handles the message as:

synchronized (SERVICE_LOCK) {

if (processMessages==false) {

xqLog.logDebug("entering service lock at:"+new Date());

while (processMessages==false) {

try { SERVICE_LOCK.wait(SERVICE_LOCK_PERIOD); } catch (InterruptedException e) { } }

xqLog.logDebug("exiting service lock at:"+new Date());

} // processMessages

}


while (serviceContext.hasNextIncoming()) {

}

3 comments:

Anonymous said...

Nice fill someone in on and this fill someone in on helped me alot in my college assignement. Thank you as your information.

Anonymous said...

Hello dude!

It is my first time here. I just wanted to say hi!

Anonymous said...

Ben almanyadan sevgi, gercekten cok guzel bir blog, eger twitter veya facebook sayfasi varsa hemen
ekliycegim.