Recovering from missing/delete queue

Hi,

We are using Axon Framework v2.4.3 and wanted to know how do we configure missing-queue-fatal as false.

We have seen that sometimes during some node switching on rabbit server, queue is available for sometime and we shutdown signal exception in our event handler. On finding out more about this, it is documented that when a queue goes missing, rabbit consumer tries to connect to the queue 3 times with time interval of 5 seconds between each attempt. This is because missing-queue-fatal configuration is set to true. If we set this to false, then recovery of consumer is started (after 3 attempts) and consumer shall try to connect to the queue after the recoveryInterval is elapsed and indefinite period.

We tried configuring this (missing-queue-fatal with recovery-interval) in our event handler but couldn’t find any documentation around this. Can somebody help us in this matter?

We tried configuring just recovery-internal in AMQP.Config but of no affect. We are unable to recover for ShutdownSignalException.

Thanks in advance.

Regards,

Ritesh

Hi Ritesh,

there isn’t a direct way to configure it, unfortunately. However, you can subclass the ListenerContainerLifecycleManager class and override the createContainer method. Call super.createContainer (which gives you Spring’s SimpleMessageListenerContainer) and add whatever configuration you need on the returned object.

Since Axon’s namespace configuration for Spring uses a hard-coded ListenerContainerLifecycleManager class, you will need to manually configure the bean and refrain from using the namespace configuration for the SpringAMQPTerminal.

Cheers,

Allard

Thanks Allard.
We solved this by extending ListenerContainerLIfecycleManager class and then overriding the hard wired bean in our spring configuration.

Regards,
Ritesh