The Groovy gateway

This gateway allows JBoss ESB services to integrate a Groovy script (http://groovy.codehaus.org/) and use it to drive messages into the bus. This powerful dynamic nature of the script allows you to integrate any supported type of external client.

The only configuration supported by this gateway is through the <groovy-listener> element which has a single attribute, script, containing the location of the script to execute.

The gateway creates three variables which can be accessed from within the script. The variables are:

  • config: references the configuration passed to the gateway
  • gateway and listener: both reference the gateway instance

A typical configuration for this gateway is shown below:

<groovy-listener name="Chapter6GroovyListener" script="mygroovyscript" is-gateway="true"/>

Have a go hero – using Groovy scripts

The groovy_gateway quickstart demonstrates the usage of a Groovy script where a Swing form is displayed to collect the message that is passed on to the ESB. Have a look at the usage of ServiceInvoker inside MessageInjectionConsole.groovy.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.59.231