Filters

Filters are Groovy expressions that are used to define the routing of messages. They are defined on sender plugins and mappers. Sender plugins use filters to decide which messages to process.

Any groovy script that returns a boolean value can be used as a filter. The information available to filter scripts, along with some examples how to use it:

Object nameMeaningExample
messagethe input GatewayMessage message.getString("ci/name").equals("server1")
msgA flattened and slurped version of the messagemsg.ci.name=="server1"
daddyA library with convenience functions

daddy.db("jdbc:mysql://dbserver1:3306/masterdb");

mymap = daddy.sql("select * from citable where name='"+msg.ci.name+"'");

return mymap!=null && mymap.get("type")=="production";