0

I have a status topic, published using QoS 1 & retained message = true over ActiveMQ (docker rmohr/activemq:5.15.9). I want my dashboard to be able to late subscribe to the topics and always receive the last published message.

The retained functionality seems to work well but the message seems to be wiped out upon ActiveMQ broker restart.

If I stop publishing to the topic, restart the broker, and try to late subscribe, I do not receive the last message (the one that was retained before the broker restart).

I use the default container configuration (kahadb & filesystem directory mounted for data/ and conf/). I thought that the retained meesage would be in kahadb but it is empty. The ActiveMQ ui also shows empty queue for topic after broker restart.

It is expected behavior? Can I achieve retained message persistence through broker restart with ActiveMQ? How should I proceed?

ThatChrisGuy
  • 559
  • 2
  • 7
  • 23
  • 1
    Looks like this is a [known issue](https://issues.apache.org/jira/browse/AMQ-6575) and there appears to be a [fix](https://github.com/apache/activemq/commit/919ca96) but if I'm reading this right it only applies to v5.16+. – Brits Oct 19 '21 at 02:57
  • I just tested with 5.16.3 and we now see the messages in kahadb. But they are still not sent to late subscribers upon broker restart. Any idea? – ThatChrisGuy Oct 19 '21 at 14:34
  • We were able to solve our problem by switching to RabbitMQ. – ThatChrisGuy Oct 20 '21 at 14:12

1 Answers1

-1

The retain message should not be lost under any circumstances unless the client publishes an empty retain message

You can switch to EMQ x to avoid this problem. You can store the data on disk or in your favorite database

wivwiv
  • 255
  • 1
  • 3