Showing posts with label Reactor. Show all posts
Showing posts with label Reactor. Show all posts

Simple Reactor with Grails 3

Posted on by Kim

(1..120).each {
    notify 'my.event', it
}

import grails.transaction.Transactional
import reactor.spring.context.annotation.Consumer
import reactor.spring.context.annotation.Selector

@Transactional@Consumerclass ReactorService {

    @Selector('my.event')
    void myEventListener(Object data) {
        log.info "S ******* GOT EVENT $data ***************** "
        sleep 2000
        log.info "E ******* GOT EVENT $data ***************** "
    }
}