Author |
Message
|
csdenis |
Posted: Tue Oct 29, 2002 6:33 pm Post subject: A long running Servlet for MQ Listener |
|
|
Novice
Joined: 06 Oct 2002 Posts: 24
|
Dear all,
I need to made a MQ listener under OS/390 by MQ Java classes (by some restriction, I am not going to use JMS).
I am planning to use a long running servlet, which will perform unlimited wait for the incoming message. Is it a good idea to start the loop in the init() method, so that it can start to listen when server start, or in the service() method, which I need to trigger it manually after server start? |
|
Back to top |
|
 |
venkataramanan |
Posted: Tue Oct 29, 2002 10:26 pm Post subject: |
|
|
 Apprentice
Joined: 18 Sep 2002 Posts: 47 Location: Chennai, India
|
HI csdenis,
Iam also planning to use JMS in my project. can i know the limitations of JMS. Could you please share with me.
with regards
venkat |
|
Back to top |
|
 |
nimconsult |
Posted: Tue Oct 29, 2002 11:20 pm Post subject: |
|
|
 Master
Joined: 22 May 2002 Posts: 268 Location: NIMCONSULT - Belgium
|
Suggestion: if you plan to use MQ Java classes, I propose an alternative to servlets: JASMQ.
JASMQ handles for you all the logic of connecting to MQ, opening the queue and retrieving messages. Basically all you have to do is implement an "onProcessMessage" method. You can make you application long running by calling the "setWaitIntervalUnlimited()" function on start-up.
You can find it for free in the software repository of this forum:
http://www.mqseries.net/pafiledb203/pafiledb.php?action=viewfile&fid=57&id=8.
The registered full version is also free and can be found on http://www.nimconsult.be.
JASMQ has been tested on MQ W2K, IBM AIX and Sun Solaris, up to now. It has not been tested on OS/390 yet, but this should not be a problem because it is 100% standard java.
The current release of JASMQ is 1.0. No major problem report has been issued yet. JASMQ 1.1 is under preparation and will soon be available. For any question or support send a mail to [url]mailto:info@nimconsult.be[/url].
Kind Regards,
Nicolas _________________ Nicolas Maréchal
Senior Architect - Partner
NIMCONSULT Software Architecture Services (Belgium)
http://www.nimconsult.be |
|
Back to top |
|
 |
csdenis |
Posted: Tue Oct 29, 2002 11:55 pm Post subject: |
|
|
Novice
Joined: 06 Oct 2002 Posts: 24
|
Thanks for your opinion, I know JMS or JASMQ maybe a better way to do the listener (actually, it provides a listener itself), but due to other restriction, I can only use MQ Java class for development. Now I need to write the listener myself (which is the long running servlet) and therefore I've my subject question. |
|
Back to top |
|
 |
techno |
Posted: Wed Jan 22, 2003 9:59 pm Post subject: |
|
|
Chevalier
Joined: 22 Jan 2003 Posts: 429
|
Have a stand-alone listener written. start this listsner on GET or POST request with a paramater with specific value.
say task=start to start the stand-alone listener from servlet doGet() |
|
Back to top |
|
 |
bduncan |
Posted: Thu Jan 23, 2003 10:38 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
I might be totally off here, but at least on the servlet runners I've used, putting something in the init() method doesn't mean it gets called when the server starts; in fact, none of the servlets get loaded automatically into the JVM. It's not until the first request that the appropriate class files are actually loaded, and then their init() methods are called, followed by the service method... Am I forgetting something here? _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
middlewareonline |
Posted: Fri Jan 24, 2003 7:09 am Post subject: |
|
|
Acolyte
Joined: 09 Jul 2001 Posts: 73
|
duncan,
one can use "load-on-startup" flag in sevlet specific xml file to indicate that it needs to load the servlet at start-up. However, if you undeploy/deploy the servlet code. You may have to do what you just said. _________________ ---------------------------------------------
IBM & SUN (J2EE) Certified Consultants,
http://www.MiddlewareOnline.com
A "SARVAM" Online Portal
http://www.SARVAM.com
--------------------------------------------- |
|
Back to top |
|
 |
|