Oct 20th, 2011, 11:42 PM
Delaying start of DefaultMessageListenerContainer
In the event that my application crashes,when it does restart, it will need to do some preprocessing before being able to processing incoming messages.
Is there a way in Spring to delay the start of the DefaultMessageListenerContainer?
I can only think of one approache:
1. Invoke some preprocessing method before the DMLC is created within the Spring container?
I believe that the DMLC automatically restarts when it is created in the container. I don't believe there is a way to have it initialized in a STOPPED mode (without listening) and then my application call DMLC.start().
Is there a way to do this?
Oct 20th, 2011, 11:52 PM
The other way to do this might be to use transacted sessions and check a flag when the first message is received. If the flag says "in recovery mode", then rollback the session until the flag says "ready to process".
But is there a better way to do this?