I have a requirement wherein the input coming in is a JMS message. One option to use would be an EJB/MDB to handle the message. I was thinking of using a solution which was scalable but not as expensive(cost/performance overhead) as the EJB. I was wondering if the Servlet API had something to offer. In my application, the JMS piece would not be a remote client but be hosted by the same machine which would host the EJB or Servlet.
Any ideas?
Thanks
Ramdas
-
Using JMS with Servlets (5 messages)
- Posted by: ramdas hegde
- Posted on: February 17 2003 19:45 EST
Threaded Messages (5)
- Using JMS with Servlets by Satish Kumar on February 18 2003 00:01 EST
- Using JMS with Servlets by Wayne Sheppard on February 18 2003 00:08 EST
- Using JMS with Servlets by ramdas hegde on February 18 2003 16:40 EST
- Using JMS with Servlets by Satish Kumar on February 19 2003 12:12 EST
- Using JMS with Servlets by ramdas hegde on February 18 2003 16:40 EST
- Apache Messenger by Michael Mattox on March 10 2003 10:14 EST
-
Using JMS with Servlets[ Go to top ]
- Posted by: Satish Kumar
- Posted on: February 18 2003 00:01 EST
- in response to ramdas hegde
Ramdas,
I don't think there are any Servlet API's for pulling or receiving a message but a Servlet can be made to receive a message by implementing the javax.jms.MessageListener interface. But then, i am not sure of the performance here. I think MDB's are better designed to handle these scenarios
cheers
Satish -
Using JMS with Servlets[ Go to top ]
- Posted by: Wayne Sheppard
- Posted on: February 18 2003 00:08 EST
- in response to ramdas hegde
Hi,
We use JMS with servlets a lot, but because we're interacting with external systems and webpages, while using JMS for certain internal messaging. But if you don't already need a servlet, and are in the same JVM, I'd go MDB.
Cheers. -
Using JMS with Servlets[ Go to top ]
- Posted by: ramdas hegde
- Posted on: February 18 2003 16:40 EST
- in response to Wayne Sheppard
Thanks for your replies.
About using Servlets to implement the MessageListener, I am not sure if that is possible. Looks like using MDBs is a more suitable solution for a JMS message consumer which is scalable.
But I was wondering, in the absence of MDBs which have come into being since EJB2.0, how did people get around building a scalable message consumer(using Java) other than buying off the shelf messaging products.
Thanks
Ramdas -
Using JMS with Servlets[ Go to top ]
- Posted by: Satish Kumar
- Posted on: February 19 2003 00:12 EST
- in response to ramdas hegde
Ramdas,
Before the advent of MDB's, WebLogic used a concept called ServerSideSessionPools for JMS. These pools were assigned to a particular queue or topic. A java class which implements a particular interface was also assigned to it for message consumption. The structure of the java class was roughly similar to MDB's except the benefits of Object pooling and transaction propagation. I am not sure of other application servers providing this mechanism but i think they would have provided something like this.
Regarding Servlet implementing MessageListener...it is possible, i have seen some sites doing it(for reasons of their own) but i think it is a bad idea
cheers
Satish -
Apache Messenger[ Go to top ]
- Posted by: Michael Mattox
- Posted on: March 10 2003 10:14 EST
- in response to ramdas hegde
I hope it's not too late. Check out Messenger in the Apache Commons project. I used it and it works great. It's like Message Driven Beans without the EJB overhead.