• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Asynchronous Messaging Solution other than MDB

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
MDB is for convenient, but you can use JMS directly, MDB isn't the only way to use JMS.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
There will be plenty of time to discuss your objections when and if you return. The cargo is this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic