Question

Currently, our application uses the grails-jms plugin. We have an ActiveMQ message queue that we connect to. The problem is that if we start up the application after a message is already on the queue, the mdp(Message Driven Pogo) tries to consume the message before grails has completely started.

(By completely started, we are noticing that the domain objects do not yet have dynamic finders on them)

A current solution we have implemented is to use message retry, and setting a configured amount of time between the retry attempts. This however cannot be our final solution.

Has anyone run into this scenario before? Does anyone have any suggestions?

Was it helpful?

Solution

I don't know grails but with Java, I would set the listener container autoStartup property to false and start() the container when you are ready. But that won't work if there's an explicit start() of the context itself before gradle is ready.

AutoStart only controls whether SmartLifecycle beans start automatically on refresh() (rather than waiting for a start()). Most SmartLifecycle objects have auto start true.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top