Kevin Rave
Kevin Rave

Reputation: 14466

Message Consumer implementation

I guess the consumer of the Messages should be listening always or should be setup in a batch to run often to check and consume messages.

When we do basic examples, we use stand alone java program that keeps running. How do we implement them in the real world web application with any Application Server like JBoss? Lets say, we use Spring MVC, Hibernate and JBoss. How is it normally implemented / set it up so it keeps running and consume messages?

(Producer can be any webpage, button click or something of that sort)

May be pretty basic dumb question. :-)

Upvotes: 0

Views: 1009

Answers (3)

Anubhab
Anubhab

Reputation: 1786

On the basis of your need you can set your listener.
Suppose if you are posting some message that should be processed as soon as it is posted then your listener should listen continuously..
On the other hand if it is not necessary to take any action immediately then it will be better if you run a separate standalone application so that the load on the server is less.
I hope you know already how to configure the listener so i am not going into that.

Upvotes: 0

John Ament
John Ament

Reputation: 11733

If your application is deployed to JBoss, you're likely looking for MDB support. If you're deploying to JBoss AS 7 this might be of interest to you.

http://www.jboss.org/jdf/quickstarts/jboss-as-quickstart/helloworld-mdb/

Upvotes: 0

Sudhakar
Sudhakar

Reputation: 4873

Heres a Nice little tutorial on How to Setup Message Listening Using Spring

Upvotes: 1

Related Questions