Win a flower (🌹) or copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java (📚) this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
master stewards:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
garden masters:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
gardeners:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Asynchronous Messaging Solution other than MDB

 
pioneer
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
gardener
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Moha Shaf
pioneer
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
gardener
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?
 
pioneer
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MDB is for convenient, but you can use JMS directly, MDB isn't the only way to use JMS.
 
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Never trust an airline that limits their passengers to one carry on iguana. Put this tiny ad in your shoe:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!