Application-level Filtering#
FastStream also allows you to specify the message processing way using message headers, body type or something else. The filter
feature enables you to consume various messages with different schemas within a single event stream.
Tip
Message must be consumed at ONCE (crossing filters are not allowed)
As an example, let's create a subscriber for both JSON
and non-JSON
messages:
Note
A subscriber without a filter is a default subscriber. It consumes messages that have not been consumed yet.
For now, the following message will be delivered to the handle
function
And this one will be delivered to the default_handler
Last update:
2023-09-21