I have an web-application and inside the server-part I created a MessageDrivenBean in order to receive messages via JMS.
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/toServer"), })
public class JMSWatcher implements MessageListener {
...
...
public void onMessage(Message message) {
....
}
But the onMessage method will never be called even if I send a message to queue/toServer like configured.
Do I need to call this bean one time from the client-application or do I need to put the class in any configuration xml file?
Thanks,
Hauke
PS.: I put some log message inside the default constructor of the JMSWatcher class but it will ne be displayed as well.
I am using JBoss 7.0.2 so I am using HornetQ as JMS Server. I configured the JMS Queue correctly because I can send messages to the queue without any problems and can receive them if I do it the old way (without MDB).
I am using Eclipse and build the project with maven. I have an ear file deployed with the server and client module.
An external process will send messages to the queue (that works).
I thought that if I do some debug messages inside the constrcutor and deploy my ear file, then I should see this message after deployment once.
I don’t need to put the MDB inside any xml file like the ServletContextListener on my web-project in the web.xml?
I am using JSF 2, so I don’t need to put that bean inside my faces-config.xml? I am not using faces-config.xml at all (in the moment).