[][broker/client] Initial implementation of message filtering - #7629
[][broker/client] Initial implementation of message filtering#7629seeday wants to merge 2 commits into
Conversation
|
Hi all. This is my first large pulsar PR, and given the contents of it I've got quite a few questions/discussion points about the implementation (in no particular order)
|
|
For changes that introduce new features or protocol changes, it's recommended to submit a PIP (design doc) for discussion to the mailing list. PTAL for examples at https://github.com/apache/pulsar/wiki |
You know, "should I open a PIP too" should have made my question list. I'll start putting one together. |
|
I've drawn a PIP up but couldn't figure out how to actually contribute it. It doesn't look like you can do wiki PRs. |
|
@seeday You can put the PIP in a Google Doc or a gist and send an email to dev@ mailing list. Once the thread is started, one of the committers will take the content and add it to Pulsar wiki. |
|
@seeday:Thanks for your contribution. For this PR, do we need to update docs? |
Motivation
Broker-side filtering of messages can reduce the network load significantly when running certain types of highly-filtered jobs. Example usecases are flink filter-pushdown, displaying data over websocket, and other network-limited actions.
So far, the list of available filters is pretty small, but this framework should make writing new ones relatively easy.
Modifications
I've modified the pulsar protocol such that clients can send a spec for filtering to the broker. The broker's Consumer class builds a filter from the arguments sent as well as the class name. I've gone with reflection because that makes for easy extension and customization of the available filters.
Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changesDocumentation