Non-Gui Web Service Termination

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Non-Gui Web Service Termination

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:00 pm

by Reagan Tukapua >> Mon, 19 Jun 2006 23:47:11 GMT

We are currently running our Jade Web Service as a Non-Gui App which is working well. We can terminate the web service process either through the Jade Monitor or through a bit of code "process.node.forceOffUser()", which seems to work fine except upon restarting the web service it doesn't accept any new requests. I believe we are not shuting down the web service correctly to begin with therefore when restarting it the old process is somehow locking a port or something else so the new process cant use it. If I restart the Jade App Server then everything seems to work again.

Any ideas on the correct way of shutting down a Non-Gui Web Service App?

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Non-Gui Web Service Termination

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:00 pm

by Torrie >> Tue, 20 Jun 2006 2:05:30 GMT

If you use the monitor or force off user, then the jade process is stopped from the server so that the client is left running and therefore doesn't release the port (You can use the netstat utility to see which process is using which port.)

One tidy way of shutting down Jade processes is to use a notification. In the initialisation method of the web service, register for a notification on some particular object (beginNotification) (I often use the process or node objects for this so you can shutdown each process or node separately.) From the management application you can then cause a notification on the particular process or node (node.causeEvent.) When the web application processes this event (userNotification method) it can then shut down cleanly (call the terminate instruction which will then call the application's finalise method.) If all the applications in the web node are shut down, then the Jadclient or Jade process will end and the port should be released.

Another option is to run the app server and the non gui client as services and shut them down by stopping the services.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 32 guests