Hi,
Am first time using Jboss 7.2 and am trying to deploy a simple MDB . The MDB is annotated for auto acknowledgment
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "/queue/test")
})
@TransactionManagement(value= TransactionManagementType.CONTAINER)
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
onMessage is simple , just sleep and awake. My expectation is as soon as message is consumed by MDB , it should be removed from Queue. But the message remains in the queue until onMessage is completed and the status shows as "In delivery".
public void onMessage(Message message) {
System.out.println("sleeping for some time");
try {
Thread.sleep(10*60000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("awake and done now");
}
When the message is completed , the log shows acknowledgment is sent. Some stupid silly configuration somewhere as it is quite simple to do. .. but any idea what is missing. How to set autoacknowledgment in JBOSS 7.2 MDB
15:59:33,584 INFO [stdout] (Thread-3 (HornetQ-client-global-threads-467768789)) awake and done now
15:59:33,586 DEBUG [org.hornetq.core.client] (Thread-3 (HornetQ-client-global-threads-467768789)) client ack messageID = 1079