import reactor.spring.context.annotation.*
@Consumer
class MyService {
}
11.3.3 Reactor Spring Annotations
Version: 3.2.6
11.3.3 Reactor Spring Annotations
Reactor provides a few useful annotations that can be used for declaratively consuming events in a Grails service.
To declare an event consumer use the Consumer
annotation:
Then to register to listen for an event use the Selector
annotation:
import reactor.spring.context.annotation.*
@Consumer
class MyService {
@Selector('myEvent')
void myEventListener(Object data) {
println "GOT EVENT $data"
}
}