Background:
I am trying to recover messages that were sent by an application to an activemq artemis queue for a disaster related scenario. The scenario goes as such artemis broker1 is up and running talking to application1 and another application2 using jms. messages are routed from application2 to artemis to application1. During use application1 dies unexpectedly while the artemis broker1 is still receiving messages from application2 resulting in a bunch of unrouted messages stacking up. The artemis broker1 dies eventually and is restarted. application1 is restarted as well. application2 never dies. when the artemis broker1 comes up I want to recover the unrouted messages. and replay them to application1. I am having problems with recovering the unrouted messages.
Things I tried:
- Implemented https://activemq.apache.org/components/artemis/documentation/latest/amqp-broker-connections.html section 4.2 and section 5. Below is section 5 configuration to implement a store-and-forward mirror. this solution does not work. when replaying messages no unrouted messages are replayed.
- I have ensured my messages have persistance=”true” in the headers. I expected that the unrouted messages would be journal-ed after being mirrored.
- confirmed that the artemis broker and it’s mirror connect via the logs and the console
Expectations: I would assume if the messages are being sent between the broker and the broker’s mirror that the messages would have been journaled. Therefore after a replay I would of had the messages replayed from application2 to application1 via the replay function in the artemis broker1. Is this assumption incorrect? The reason I used the replay function was that no messages automatically triggered upon the artemis broker1 coming back up.
Configuration:
configuration for the mirror in the broker.xml is below. the acceptors have the correct ports for the mirror and the original broker
<broker-connections>
<amqp-connection uri="tcp://artemis-mirror:5674" name="mirror" retry-interval="1000" user="myuser" password="mypassword">
<mirror>
</mirror>
</amqp-connection>
</broker-connections>
reverse mirror
<broker-connections>
<amqp-connection uri="tcp://artemis-broker:5672" name="original" retry-interval="1000" user="myuser" password="mypassword">
<mirror>
</mirror>
</amqp-connection>
</broker-connections>
Journaling configuration
<persistence-enabled>true</persistence-enabled>
<journal-retention-directory period="6" unit="DAYS" storage-limit="10G">data/retention</journal-retention-directory>
<journal-datasync>true</journal-datasync>
<journal-min-files>2</journal-min-files>
<journal-pool-files>10</journal-pool-files>
<journal-device-block-size>4096</journal-device-block-size>
<journal-file-size>10M</journal-file-size>
Additional details:
I am using version 2.33 of artemismq I followed the disaster recovery example from the examples for the configuration above.
user4061776 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.