Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why won't topic messages get dequeued?

Tags:

java

activemq

I want to ask a question about the topics of activemq.

I entered admin page of activemq and found that messages enqueued will never be dequeued in topics even if consumers had been written correctly. That means the all published messages will be permanently kept in ActiveMQ.

Will these message lead to a memory leak? Is there a solution that could make consumed messages dequeued?

enter image description here

like image 793
Mr rain Avatar asked Oct 21 '22 01:10

Mr rain


1 Answers

I think you may need to config your session with the right way. connection.createSession(Boolean.FALSE, Session.AUTO_ACKNOWLEDGE) ActiveMQ will only marked the message to Dequeued by your code if you use a transaction or Session.CLIENT_ACKNOWLEDGE

like image 140
jujusharp Avatar answered Oct 28 '22 21:10

jujusharp