Skip to content

autoStart configuration for rabbitmq plugin #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rubindersingh opened this issue Apr 13, 2016 · 1 comment
Open

autoStart configuration for rabbitmq plugin #24

rubindersingh opened this issue Apr 13, 2016 · 1 comment

Comments

@rubindersingh
Copy link

Currently, rabbitmq plugin create and start listeners at bootstrap time. It would be more convenient if autoStart configuration could be added like "disableListening" to configure that if we want to start consumers to consume messages at the time of creation or not. We are facing issue that when rabbitmq is configured and started, it starts consuming messages and then call services to perform operations. Many a times, service class beans are not yet initialized which lead to errors in processing messages. If we could stop consumers to read from queue until manuall start at later point of time in grails application bootstrap's init block. Then, this problem can be avoided. As consumers will not start reading messages from queues until directed.
If you did not understand problem or need further inputs, please revert.

Regards,
Rubinder Singh

@ronicthomas
Copy link

ronicthomas commented Apr 20, 2016

There's already an option called "disableListening" that will disable all listeners. However, this will not register the listener beans as well. Either of the two options should be sufficient for your case:

  • What you're looking for is to either load the rabbitmq plugin after the services and controllers
  • Allow an option to disable listeners on application start, but still register the beans and provide a method to manually start them, probably in Bootstrap.groovy

Personally, I like the second option since it gives you more control. I could put in a PR for the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants