I'm using the following code to receive a message. After a successful read I was expecting that the message is remove from the queue?! But the message was still in the queue. How can I read a message and remove it?
String result; ClientSession session = this.sessionFactory.createSession(); try { session.start(); ClientConsumer consumer = session.createConsumer(ACTIVE_MQ_SMTP_QUEUE); ClientMessage message = consumer.receive(); result = message.getDataBuffer().readString(); message.acknowledge(); session.commit(); } finally { session.close(); }