I'm trying to solve following problem:
- I have 2 SimpleMessageListenerContainer defined in java conf.
- Each of them has it's own listener wrapped with adapter and they both use same CachingConnectionFactory(is it ok?). In addition each of them handles different queue(with constant name)
- I'm testing scenario when for whatever reason one of the queues is deleted.
- When I'm deleting it manually from web admin console the container tries to redefine this queue and fails(all retries fail). The exception is not really tells the reason of the failure.
- Eventually all the consumer threads of this queue are "restarted" however they wont consume any messages further. Even though somebody else will redefine this queue(e.g. producer)
so there are several questions:
- Can I fix redefinition of the queue somehow, or check why the redefinition fails? On fresh start the definition of queues works. Which brings me to next question
- Might be I can make heartbeat sender to use daemon thread somehow? It prevents jvm from exiting, so the restart isn't happening. It won't solve problem, but fresh jvm process succeeds to redefine queues. Restart will be caused by supervisor.
Meanwhile I'm getting situation when all consumers(under first container) for deleted queue are not really working, I'd expect that jvm will exit, however probably since I have second container which is ok(all consumers alive and queue exists), the jvm continues to live(might be when second container will be shutdown the heartbeat sender also will stop?)
any suggestions will be appreciated. If needed I'll post code snippets of java configuration.