(Quick Reference)

11.2.3 Reactor Spring Annotations - Reference Documentation

Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith, Lari Hotari

Version: 3.1.6

11.2.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('my.event') void myEventListener(Object data) { println "GOT EVENT $data" } }