gpc / jms

JMS integration for Grails.
http://grails.org/plugin/jms
16 stars 28 forks source link

autoStartup=false is not working in 2.0.0.RC2 #40

Closed rupsin closed 3 years ago

rupsin commented 5 years ago

Define a listener bean using parent bean as :

eventProcessorListenerContainer {
                meta {
                    parentBean = 'standardJmsListenerContainer'
                }
                concurrentConsumers = 1
                autoStartup = false
                maxMessagesPerTask = -1
                idleTaskExecutionLimit = 20
            }

But when the application server starts, the eventProcessorListenerContainer is already running (isActive=true, and isRunning=true but autoStartup=false)

I believe this is because the plugin code calls the start() method on all the listener containers. Specifically, this piece of code in https://github.com/gpc/jms/blob/v2.0.0.RC2/src/main/groovy/grails/plugin/jms/JmsGrailsPlugin.groovy Method doWithApplicationContext():

 void doWithApplicationContext() {
        listenerConfigs.each { serviceClassName, serviceClassListenerConfigs ->
            serviceClassListenerConfigs.each {
                startListenerContainer(it, applicationContext)
            }
        }

The code above starts all the containers irrespective of the autoStartup property. The right thing would be to check for autoStartup property before starting the container.

henrywu1 commented 3 years ago

I am also running into this issue. Is there a work around for this issue?

github-actions[bot] commented 3 years ago

Stale issue message