Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Convenience filter all consumer filter #965

Merged
merged 3 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ object ConsumerFilter extends ExtensionId[ConsumerFilter] {
sealed trait FilterCriteria
sealed trait RemoveCriteria extends FilterCriteria

/**
* Exclude events from all entity ids, convenience for combining with for example a topic filter
* to include only events matching the topic filter.
*/
val excludeAll = ExcludeRegexEntityIds(Set(".*"))
johanandren marked this conversation as resolved.
Show resolved Hide resolved

/**
* Exclude events with any of the given tags,
* unless there is a matching include filter that overrides the exclude.
Expand Down
4 changes: 4 additions & 0 deletions docs/src/main/paradox/grpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ events are still transferred to the consumer, to ensure sequence number validati
Filters can be used when a consumer is only interested in a subset of the entities. The filters can be defined
on both the producer side and on the consumer side, and they can be changed at runtime.

By default, all events are emitted, and filters selectively choose what events to filter out. For some of the filters
it is useful to first define a @apidoc[ConsumerFilter.excludeAll](ConsumerFilter$) filter and then selectively include events.
For example to only include events from topics matching topic filters.

@@@ note

The purpose of filters is to toggle if all events for the entity are to be emitted or not.
Expand Down