11.3.3 Reactor Spring Annotations 3.2.8

(Quick Reference) # 11.3.3 Reactor Spring Annotations Version: 3.2.8 ## 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:
    import reactor.spring.context.annotation.*

    @Consumer
    class MyService {

    }
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"
            }
    }
| Quick Reference (hide)