Egress route filtering for completion events
It is possible now to filter messages and batches that are routed to the egress sink by specifying a filter condition. The filter condition is a SQL-like expression, e.g. metadata.messageId = 'report' AND starts_with(metadata.deviceId, 'prod')
. If the condition evaluates to true
, the event is routed to the egress sink. Otherwise, the event is discarded.
Correspondingly, the CLI commands for creating and updating routes has been extended to support filtering:
spotf stream egress-route create-or-update sql \
--name "sql-route" \
--stream-group-name "example-group" \
--stream-name "example-stream" \
--egress-sink-name "postgresql-sink" \
--with-filter "metadata.messageId = 'report'"