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

doc: Reference docs of filters #846

Merged
merged 6 commits into from
Apr 12, 2023
Merged

Conversation

patriknw
Copy link
Member

@patriknw patriknw commented Apr 5, 2023

  • simplified the consumer side filter sample to also use tags

Not all Java snippets are updated yet. The Java samples are more difficult to update because they use the bom dependencies. We'll make a separate round with the Java samples.

The exclude criteria can be a combination of:

* `IncludeTags` - include events with any of the given tags
* `IncludeEntityIds` - include events for entities with the given entity ids
Copy link
Member Author

Choose a reason for hiding this comment

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

For symmetry we should probably add IncludeRegexEntityIds. Wouldn't be difficult. IncludeTags is anyway a similar kind of wildcard filter so with the lazy replay in place we can add IncludeRegexEntityIds.

@patriknw patriknw force-pushed the wip-filter-docs-patriknw branch from 1c37af5 to 70e79e7 Compare April 5, 2023 13:49
Copy link
Member

@octonato octonato left a comment

Choose a reason for hiding this comment

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

LGTM

with some minor comments

docs/src/main/paradox/grpc.md Outdated Show resolved Hide resolved
Comment on lines 192 to 196
* Exclude criteria are evaluated first.
* If no matching exclude the event is emitted.
* If an exclude is matching the include criteria are evaluated.
* If no matching include the event is discarded.
* If matching include the event is emitted.
Copy link
Member

Choose a reason for hiding this comment

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

Can be confusing with words "exclude" and "include" are used as nouns.

We can append "criterion" / "criteria" to it.

Suggested change
* Exclude criteria are evaluated first.
* If no matching exclude the event is emitted.
* If an exclude is matching the include criteria are evaluated.
* If no matching include the event is discarded.
* If matching include the event is emitted.
* Exclude criteria are evaluated first.
* If no matching exclude criterion, then the event is emitted.
* If an exclude criterion matches, then the include criteria are evaluated.
* If no matching include criterion, then the event is discarded.
* If matching include criterion, then the event is emitted.

or

Suggested change
* Exclude criteria are evaluated first.
* If no matching exclude the event is emitted.
* If an exclude is matching the include criteria are evaluated.
* If no matching include the event is discarded.
* If matching include the event is emitted.
* Exclude criteria are evaluated first.
* If no matching `exclude`, then the event is emitted.
* If an `exclude` is matching, then the `include` criteria are evaluated.
* If no matching `include`, then the event is discarded.
* If matching `include`, then the event is emitted.

Copy link
Member Author

Choose a reason for hiding this comment

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

sounds good to add criteria. I think I prefer criteria over criterion. Both are grammatically correct. criteria can be used as both singular and plural

Copy link
Member Author

Choose a reason for hiding this comment

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

added in 6da5e78

Copy link
Member

Choose a reason for hiding this comment

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

Looks good.

Copy link

@efgpinto efgpinto left a comment

Choose a reason for hiding this comment

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

Some tiny suggestions but this looks good from my someone-who-has-not-looked-at-this-before eyes.

//#tags
@Override
public Set<String> tagsFor(Event event) {
// FIXME state.tags
Copy link

Choose a reason for hiding this comment

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

Do we want to fix this or as follow-up?

Copy link
Member Author

Choose a reason for hiding this comment

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

java samples will be updated separately

)
//#eventProducerService
//#eventProducerService
// FIXME withProducerFilter
Copy link

Choose a reason for hiding this comment

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

So this will be fixed on a follow-up right?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, will update the java samples separately. slightly difficult because of the bom dependencies

docs/src/main/paradox/grpc.md Outdated Show resolved Hide resolved
docs/src/main/paradox/grpc.md Outdated Show resolved Hide resolved
running with Akka Cluster the filter is propagated to other nodes in the cluster automatically with
Akka Distributed Data. You only have to update at one place and it will be applied to all running Projections
with the given `streamId`. The filters will be cleared in case of a full Cluster stop, which means that you
need to take care of populating the initial filters at startup.
Copy link

Choose a reason for hiding this comment

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

Could this part "The filters will be cleared in case of a full Cluster stop, which means that you
need to take care of populating the initial filters at startup." be worth of a warning note?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

patriknw and others added 5 commits April 12, 2023 14:47
* simplified the consumer side filter sample to also use tags
Co-authored-by: Eduardo Pinto <efgpinto@gmail.com>
Co-authored-by: Eduardo Pinto <efgpinto@gmail.com>
@patriknw patriknw force-pushed the wip-filter-docs-patriknw branch from a3d251e to f23226b Compare April 12, 2023 12:48
@patriknw patriknw merged commit 58bba6d into dev-filter Apr 12, 2023
@patriknw patriknw deleted the wip-filter-docs-patriknw branch April 12, 2023 14:14
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