...
The Predicate
interface is described above. The interface will be a worker plugin, loaded in the same way as other worker plugins such as converters, connectors, and REST extensions. This would includes aliasing behavior allowings users to specify predicates using their simple class names as long as no two predicate plugins with the same simple name are available on the worker.
In order to negate the result of a predicate all predicates will implicitly support a boolean negate
configuration parameter, which defaults to false.
...
test()
will return true when the ConnectRecord.topic()
(i.e. it's name) matches a given Java regular expression pattern.
Config name | Type | Default | Required |
---|---|---|---|
pattern | String | null | yes |
HasHeaderKey
test()
will return true when the ConnectRecord.headers()
has 1 or more headers with a given key.
Config name | Type | Default | Required |
---|---|---|---|
name | String | null | yes |
RecordIsTombstone
test()
will return true when the ConnectRecord
represents a tombstone (i.e. has a null value). This predicate has no configuration parameters.
...
If during processing the predicate throws an exception the condition this will be treated as not having been matched, the guarded SMT will not be applied and the exception logged. Note this behaviour is independent of the negate
parameter.handled in the same way as errors in transformations.
Consider the following example of a transformation chain with a single conditionally applied SMT:
...
If during processing the predicate throws an exception the condition this will be treated as not having been matched, the record will be filtered and the exception logged. Note this behaviour is independent of the negate
parameterhandled in the same way as errors in transformations.
Changes to Transformation
...