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 name | Meaning | Example |
---|
message | the input GatewayMessage | message.getString("ci/name").equals("server1") |
msg | A flattened and slurped version of the message | msg.ci.name=="server1" |
daddy | A 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"; |