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 » IBM MQ Java / JMS » A long running Servlet for MQ Listener

Post new topic  Reply to topic
 A long running Servlet for MQ Listener « View previous topic :: View next topic » 
Author Message
csdenis
PostPosted: Tue Oct 29, 2002 6:33 pm    Post subject: A long running Servlet for MQ Listener Reply with quote

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
View user's profile Send private message
venkataramanan
PostPosted: Tue Oct 29, 2002 10:26 pm    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger MSN Messenger
nimconsult
PostPosted: Tue Oct 29, 2002 11:20 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
csdenis
PostPosted: Tue Oct 29, 2002 11:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
techno
PostPosted: Wed Jan 22, 2003 9:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
bduncan
PostPosted: Thu Jan 23, 2003 10:38 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
middlewareonline
PostPosted: Fri Jan 24, 2003 7:09 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » A long running Servlet for MQ Listener
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.