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
External Groovy Scripts For Dao Events #51
Comments
We can do the similar thing as asgard example above, register groovy beans from scripts. |
Example in benchmarks project |
Add instructions for how we are doing this for events to the docs. |
#51 Add docs for external event listeners
@snimavat Example doesn't look right. Good example for how to add listeners but not for refreshable beans |
@snimavat clear example of setting up events listeners in the refreshable beans, @eventlistener won't work. I think it should be referenced and pointed to from docs on events. basically, doc what we are doing in the benchmarks with CitySpringEventsRefreshable and CityRefreshableBeanSubscriber (<- if that still relevant) |
also, both |
We want to be able to have external groovy scripts to run custom business logic during the dao events. For example, at one customer we do special customer.num generation before a new customer object is saved.
this plugin should detect an external scripts executor plugin.
we should have a contract on how the scripts are called. Either we have the script return an object implementing a trait or interface and then it can get registerd, or we have the script run and register a listener using the grails 3.3 events.
see the end of this as an example. https://github.com/Netflix/asgard/blob/master/grails-app/conf/spring/resources.groovy
we could setup reloadable groovy beans.
see https://docs.spring.io/spring/docs/current/spring-framework-reference/languages.html#groovy and http://mrhaki.blogspot.com/2013/03/grails-goodness-use-constructor.html
The text was updated successfully, but these errors were encountered: