Search code examples
springjbossjmsimplementationconsumer

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. :-)


Solution

  • 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.