I'm developing a web app using JBoss 6.1 as backend.
I created a message driven bean with the "destination" property: "queue/searchtabQueue" and "destination type" property "javax.jms.Queue".
As described under https://community.jboss.org/wiki/HowToCreateJMSQueuetopicInAS6 I managed to create my queue "queue/searchtabQueue" ("searchtab-hornetq-jms.xml"):
<configuration xmlns="urn:hornetq"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
<queue name="searchtabQueue">
<entry name="/queue/searchtabQueue"/>
</queue>
</configuration>
After the deployment, in the admin console, I see my queue under "JMS Queues" with status "up".
In a stateless bean I'm doing the look up for the queue, which works correct, and also the sending throws no exception:
Context ctx = new InitialContext(p); // Create the initial context
ConnectionFactory factory = (ConnectionFactory) ctx.lookup("ConnectionFactory");
Queue queue = (Queue) ctx.lookup("queue/searchtabQueue");
Connection connect = factory.createConnection();
javax.jms.Session session = connect.createSession(false, 0);
MessageProducer sender = session.createProducer(queue);
TextMessage msg = session.createTextMessage();
msg.setText("abc");
sender.send(msg);
connect.close();
But the onMessage method of the message driven bean is not called.
What am I missing?
Thanks alot in advance
Wolfgang
Update: My MDB-Code:
My message driven bean has the following code:
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination",
propertyValue = "queue/searchtabQueue"),
@ActivationConfigProperty(propertyName = "acknowledgeMode",
propertyValue = "Auto-acknowledge")
})
public class SearchTableBean implements MessageListener {
public void onMessage (Message message) {
}
}