Chapter 60. Predicate Filter Action
Filter based on a JSONPath Expression. Since this is a filter, the expression is a negation. This means that if the foo field of the example is equal to John, the message goes ahead. Otherwise it is filtered out.
60.1. Configuration Options Copy linkLink copied to clipboard!
The following table summarizes the configuration options available for the predicate-filter-action Kamelet:
| Property | Name | Description | Type | Default | Example |
|---|---|---|---|---|---|
| expression * | Expression |
The JSONPath Expression to evaluate, without the external parenthesis. Since this is a filter, the expression is a negation. This means that if the | string | @.foo =~ /.*John/ |
* = Fields marked with an asterisk are mandatory.
60.2. Dependencies Copy linkLink copied to clipboard!
60.2.1. Quarkus dependencies Copy linkLink copied to clipboard!
60.3. Usage Copy linkLink copied to clipboard!
60.3.1. Camel JBang usage Copy linkLink copied to clipboard!
60.3.1.1. Prerequisites for JBang Copy linkLink copied to clipboard!
- Install JBang.
You have executed the following command:
jbang app install camel@apache/camel
jbang app install camel@apache/camelCopy to Clipboard Copied! Toggle word wrap Toggle overflow
60.3.1.2. Running a route with JBang Copy linkLink copied to clipboard!
Suppose you have a file named route.yaml with this content:
You can now run it directly through the following command.
camel run route.yaml
camel run route.yaml
60.3.2. Knative Action Copy linkLink copied to clipboard!
You can use the predicate-filter-action Kamelet as an intermediate step in a Knative binding.
predicate-filter-action-binding.yaml
60.3.3. Kafka Action Copy linkLink copied to clipboard!
You can use the predicate-filter-action Kamelet as an intermediate step in a Kafka binding.
predicate-filter-action-binding.yaml