21. Mai 2012

Apache Camel plug-in for Grails

The Apache Camel Grails plug-in allows you to send and route messages to a wide variety of destination endpoints directly from your controllers and services. It also provides a new Grails artifact, Routes, to configure your routes using known Enterprise Integration Patterns via the Apache Camel Java DSL.

It is quite easy to route messages. For example, write a Grails service like this:

class MyService {
    def myMethod(fooBarText) {
        log.info “Got text: ${ fooBarText }}
}

Then, using Camel’s bean integration, you can deliver messages from an in-memory queue directly to that Grails service:

from(“seda:my.queue).filter {
    it.in.body.contains(“FooBar”)
}.to(“bean:myService?methodName=myMethod”)

Cool, isn’t it? As usual, you can find more info on the plugin page on grails.org.

Diese Beiträge könnten Sie noch interessieren:

Ihre Meinung ist uns wichtig

*