Closed jindalshivali closed 6 months ago
Currently, when the startListenerContainer()
method is invoked, below is what happens.
def startListenerContainer(listenerConfig, applicationContext) {
applicationContext.getBean(listenerConfig.listenerContainerBeanName).start()
}
Instead the code should be as below:
def startListenerContainer(listenerConfig, applicationContext) {
def listenerContainer = applicationContext.getBean(listenerConfig.listenerContainerBeanName)
if (listenerContainer.isAutoStartup()) {
listenerContainer.start()
}
}
@jindalshivali can you submit a pull request?
We have a forked version of the repo which is currently being used after the fix in our application. Will submit a PR.
Added the PR to the issue.
Steps to reproduce:
Define a listener bean:
When the application server starts, the eventListenerContainer is already running (isActive=true, and isRunning=true but autoStartup=false)
This seems to be because the plugin code calls the start() method on all the listener containers during application Context start irrespective of whether or not the
autoStartup
field is set to true.It looks like the code in below file https://github.com/gpc/jms/blob/master/src/main/groovy/grails/plugin/jms/JmsGrailsPlugin.groovy Method
The code above starts all the containers irrespective of the autoStartup property.