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

Streams filters #893

Merged
merged 24 commits into from
Jan 23, 2025
Merged

Streams filters #893

merged 24 commits into from
Jan 23, 2025

Conversation

viktorerlingsson
Copy link
Member

@viktorerlingsson viktorerlingsson commented Dec 18, 2024

WHAT is this pull request doing?

Adds support for filtering in streams.

Filters can be set on messages by providing x-stream-filter-value when publishing messages to a stream.
When a consumer tries to consume with x-stream-filter set, only messages matching the filter value will be returned. x-stream-filter on consumers can be a single value as a string, or a set of values separated by commas. Any message matching any of the filters on the consumer will be returned.

You can also choose to return all messages without a filter by providing x-stream-match-unfiltered as an argument on the consumer.
If you do not provide x-stream-filter when consuming, all messages in the stream will be returned as if no filters existed.

HOW can this pull request be tested?

Run specs

@viktorerlingsson viktorerlingsson marked this pull request as ready for review January 7, 2025 14:24
@viktorerlingsson viktorerlingsson requested a review from a team as a code owner January 7, 2025 14:24
Copy link
Member

@spuun spuun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comments.

edit: lol, i must have hit the wrong button making it multiple reviews... 🤦

src/lavinmq/amqp/queue/stream_queue_message_store.cr Outdated Show resolved Hide resolved
src/lavinmq/amqp/queue/stream_queue_message_store.cr Outdated Show resolved Hide resolved
src/lavinmq/amqp/queue/stream_queue_message_store.cr Outdated Show resolved Hide resolved
src/lavinmq/amqp/stream_consumer.cr Show resolved Hide resolved
src/lavinmq/amqp/stream_consumer.cr Show resolved Hide resolved
src/lavinmq/amqp/stream_consumer.cr Outdated Show resolved Hide resolved
src/lavinmq/amqp/stream_consumer.cr Outdated Show resolved Hide resolved
src/lavinmq/amqp/queue/stream_queue_message_store.cr Outdated Show resolved Hide resolved
src/lavinmq/amqp/queue/stream_queue_message_store.cr Outdated Show resolved Hide resolved
src/lavinmq/amqp/queue/stream_queue_message_store.cr Outdated Show resolved Hide resolved
@viktorerlingsson viktorerlingsson added this to the v2.2 milestone Jan 20, 2025
src/lavinmq/amqp/stream_consumer.cr Outdated Show resolved Hide resolved
@viktorerlingsson viktorerlingsson merged commit 09a75d3 into main Jan 23, 2025
23 of 25 checks passed
@viktorerlingsson viktorerlingsson deleted the streams-filters branch January 23, 2025 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants