<@U078Y59KC3B> what are entry filters and is it po...
# ask-ai
s
@RunLLM what are entry filters and is it possible to configure it for a specific subscription to filter out messages with specific attributes?
r
Entry filters in Pulsar are pluggable broker-side plugins that allow you to filter messages before they are delivered to consumers, based on message metadata or subscription properties. They are implemented by creating a class that implements the
EntryFilter
interface, packaging it as a NAR file, and configuring it in the broker (
entryFilterNames
and
entryFiltersDirectory
in
broker.conf
) or at the namespace/topic level using the admin API. The filter logic can access message properties and subscription properties to decide whether to accept, reject, or reschedule a message for delivery to a consumer. See Pulsar plugin development docs and EntryFilter interface. It is possible to filter messages for a specific subscription by using subscription properties as part of your filter logic. When creating a consumer, you can set
subscriptionProperties
, and the filter can use these properties to match and filter messages with specific attributes (e.g., message properties). Example usage and test cases are shown in TestEntryFilters.java and PatternEntryFilter.java. Would you like more detail or a code example? Sources: - Pulsar plugin development docs - TestEntryFilters.java - PatternEntryFilter.java - EntryFilter interface 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.