-
Notifications
You must be signed in to change notification settings - Fork 146
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
Allow subscriptions to filter the events they receive #114
Conversation
Initial proposal for event filtering
Subscriptions will wait until the last event sent to the subscriber has been successfully acknowledge. If this event is filtered, then the subscriber cannot ack it, instead the subscription will remain stuck.
@ArThien Thanks for taking the time to add this feature. The Unfortunately there's an issue with the implementation due to the way that subscribers must successfully acknowledge each received event. If an event is filtered by the selector function and not sent to the subscriber, it won't be acknowledged. The subscription will then become stuck waiting for the ack it'll never be sent. I've added a failing unit test to branch pr/114 to demonstrate the problem. I haven't thought of a way to resolve the issue, yet. The subscription process will likely need to remember which events have been filtered so it doesn't need to wait for the acknowledgement. |
@slashdotdash how do you feel about resolving the ack on the producer's end? Instead of |
I’m looking at reworking the subscription FSM so that it remembers filtered event numbers and can automatically acknowledge them as required. |
@slashdotdash we could add the filtered events to the state struct and keep track of them in a similar way |
I've reworked the subscription FSM to track the event number for any filtered events in the feature/rework-subscription-catch-up branch. This allows the subscription to acknowledge any subsequent filtered events when the subscriber acks an event. |
Add failing test for subscription selector function. Subscriptions will wait until the last event sent to the subscriber has been successfully acknowledge. If this event is filtered, then the subscriber cannot ack it, instead the subscription will remain stuck. Remove separate catch-up subscription process. Rename `last_seen` to `last_sent` in subscription FSM.
Merged! |
Based on #109 this would follow GenStage's lead by implementing a
selector
function that is run first filtering all events before being sent to subscribers.