aspose file tools*
The moose likes Distributed Java and the fly likes Asynchronous Messaging Solution other than MDB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Asynchronous Messaging Solution other than MDB" Watch "Asynchronous Messaging Solution other than MDB" New topic
Author

Asynchronous Messaging Solution other than MDB

Moha Shaf
Ranch Hand

Joined: Aug 30, 2008
Posts: 30
I am looking for a solution where my application can put messages to be read by another listener for further processing. I do not want to go for MDBs as I do not want to use EJB container (My application runs on a Tomcat). Is there any J2EE or non J2EE alternative?

Thanks in advance for your help.
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

You do not necessarily need an MDB if you want to do messaging or use JMS.
There are many JMS vendors, few of which like ActiveMQ are free.


apigee, a better way to API!
Moha Shaf
Ranch Hand

Joined: Aug 30, 2008
Posts: 30
I want to read messages as the messages come to the queue. Its not a request response messaging that I wanted to do. I want to process messages asynchronously as they come to a queue. I know that MDB is a choice. What if I do not have the option of doing it through an MDB. Is a scheduler to read the messages from the queue a viable option? Is there any other better options available.

And my another question is, if it can be done through other means such a scheduler why do we need MDB at all.

Thanks.
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

Moha:
I want to read messages as the messages come to the queue. Its not a request response messaging that I wanted to do. I want to process messages asynchronously as they come to a queue.

JMS is not always request-response. It can be a fire-and-forget mode also and it is always asynchronous.
So, I do not understand what do you want to convey with this.

Moha:
Is a scheduler to read the messages from the queue a viable option? Is there any other better options available.

When you register a listener to a queue/topic you get an intimation when a message is available. It is a "push" model VS a "pull" model that a scheduler follow.

Moha:
And my another question is, if it can be done through other means such a scheduler why do we need MDB at all

Thats the point with any EJB.
You can call a business processing object without a session bean.
You can access a DB/persistent store without an Entity Bean.
So, Why use EJBs?
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
MDB is for convenient, but you can use JMS directly, MDB isn't the only way to use JMS.


SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Bobby Lewis
Greenhorn

Joined: Jul 30, 2002
Posts: 4
The original poster may want to check out Spring Message Driven POJOs or MDPs. This is a Spring framework for producing and consuming messages on a JMS queue or topic which does not require an EJB container. We've found it easy to use and it integrates nicely of course with the rest of our Spring solutions.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Asynchronous Messaging Solution other than MDB