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 » JMS Message listener

Post new topic  Reply to topic
 JMS Message listener « View previous topic :: View next topic » 
Author Message
subhendu
PostPosted: Tue Mar 12, 2002 7:08 am    Post subject: Reply with quote

Novice

Joined: 05 Mar 2002
Posts: 18

I want to call the message listener in the start up servlet. So that when a message arrives it will be taken care as servlet instance is running always.

IS this approach is correct ?? Can i achieve the same thing in different way.I am using WAS application server 3.5.

Thanks,
Subhendu
Back to top
View user's profile Send private message
kolban
PostPosted: Tue Mar 12, 2002 7:19 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

Although not a J2EE specialist, I am thinking that the purpose of a Servlet is to handle incoming Web based requests and that attempting to do other work (such as watching for incoming messages) in the context of a Servlet hosted by a web container is probably not what the J2EE designers had in mind. I suspect that a message driven bean (WAS 4.0 EE) is probably more in line with what you want.
Back to top
View user's profile Send private message
subhendu
PostPosted: Tue Mar 12, 2002 7:39 am    Post subject: Reply with quote

Novice

Joined: 05 Mar 2002
Posts: 18

I am using ejb1.1, so i can not use MDB.
Back to top
View user's profile Send private message
ourtown
PostPosted: Tue Mar 26, 2002 3:54 pm    Post subject: Reply with quote

Acolyte

Joined: 05 Feb 2002
Posts: 67
Location: Somerset, NJ

It seems a waste to use an AppServer Servlet to host an MQ Service - why not just run standalone ?

However the approach will work as would writing an EJB not even an MDB. With an EJB you would have to get it running when the AppServer started but you would have more control over its behaviour

Back to top
View user's profile Send private message Send e-mail
middlewareonline
PostPosted: Mon Apr 01, 2002 1:47 pm    Post subject: Reply with quote

Acolyte

Joined: 09 Jul 2001
Posts: 73

EJB wont; be able to handle this scenario ( that is why MDB was introduced). When you implment a bean a message listener it may behave strngley. As you have are setting the listener to a bean which may be passivated by container.

Also, as mentioned Servlet is to handle htpp requests. What you can do though is write an ejb client (outside of app server) have it implment a message listener interface (on message method) and do whatever you need to do from there. Keep in mind this process is outside the container so you will have to take care of failover etc.

Raj


_________________
---------------------------------------------
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
ourtown
PostPosted: Thu Jul 18, 2002 7:18 am    Post subject: Reply with quote

Acolyte

Joined: 05 Feb 2002
Posts: 67
Location: Somerset, NJ

Just getting back to this thread after a long time

Running a message listener in a servlet is very reasonable - all you use are the start up and shutdown routines - the http capabilities are irrelevant.

The appserver ensure that the servlet starts when the appserver starts and stops with the appserver.

You then have a pattern that you can use for other message listeners and you dont have to configure MDB/EJBs to autostart, worry about keeping the bean active etc

Brian S. Crabtree
EAI Consultant
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » JMS Message 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.