Skip to content

Support updating PCGroup filters dynamically#41

Closed
colprog wants to merge 3 commits intosynadia-io:Multiple-Subscription-Filtersfrom
colprog:Multiple-Subscription-Filters
Closed

Support updating PCGroup filters dynamically#41
colprog wants to merge 3 commits intosynadia-io:Multiple-Subscription-Filtersfrom
colprog:Multiple-Subscription-Filters

Conversation

@colprog
Copy link
Copy Markdown
Contributor

@colprog colprog commented Mar 6, 2026

This PR adds runtime partitioning-filter management for Elastic PCGroups and fixes NatsPcgPartitioningFilter value semantics.

Changes

  • Added:
    • AddPcgElasticFiltersAsync(...)
    • DeletePcgElasticFiltersAsync(...)
  • NatsPcgPartitioningFilter now compares by value (Filter + PartitioningWildcards) via custom Equals/GetHashCode.

@colprog colprog changed the title Support updatign PCGroup filters dynamically Support updating PCGroup filters dynamically Mar 6, 2026
* Add support for multiple filters in static and elastic consumer group configurations

Refactored filtering logic, added utility methods, extended validations, updated related tests, and enhanced handling of wildcard-based partitioning.

* Add test to verify partitioning behavior with full-subject hash in elastic consumer groups.

* Add compatibility notes for .NET-only multi-filter and [-1] sentinel features in consumer groups

* Add server version guard in elastic consumer group tests for [-1] sentinel support.

* Update compatibility notes for .NET-only multi-filter and [-1] sentinel features in consumer group configurations

* Refactor elastic consumer group configuration to replace wildcards with `NatsPcgPartitioningFilter`, simplify validations, and update related tests.

* Update partitioning filter in paritiy

* fix build

* tests: fix elastic PCGroups CI failures

Use unique GUID-based subject prefixes in all elastic tests to prevent
"subjects overlap with an existing stream" errors when multiple TFMs
share the same NATS server in CI.

Add SkipBelow212Async to the empty PartitioningFilters test since
full-subject partitioning requires NATS 2.12+. Fix the work-queue
stream name assertion (was incorrectly prefixed with "pcg-") and add
proper cleanup in try/finally.

* tests: add Go interop tests for elastic PCGroups

Use GoHarness to verify cross-language interop with orbit.go
pcgroups v0.2.0. Three tests cover .NET-creates/Go-consumes,
Go-creates/.NET-consumes, and empty PartitioningFilters interop.

* tests: skip Go interop consume tests on NATS < 2.11

ElasticConsume uses priority groups which require NATS 2.11+.
The Go process exits with an error on 2.10, causing the test to
fail on ReadLineAsync.
@mtmk
Copy link
Copy Markdown
Collaborator

mtmk commented Mar 27, 2026

Hey @colprog, #40 is now merged. You'll need to rebase onto main, your commit (dca419c) cherry-picks cleanly so that should be straightforward. Also update the PR base branch to main.

cc @jnmoyne, this adds runtime filter add/delete for elastic PCGroups which isn't in orbit.go yet. Worth a look before we go ahead with it.

@colprog colprog force-pushed the Multiple-Subscription-Filters branch from dca419c to 0828d5d Compare March 27, 2026 16:52
@colprog colprog closed this Mar 27, 2026
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.

2 participants