Skip to content

Commit 7111227

Browse files
committed
Add feature flag warning
Signed-off-by: Gabriele Santomaggio <[email protected]>
1 parent 2b72a3f commit 7111227

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

RabbitMQ.Stream.Client/Consts.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ internal static class Consts
2020
internal const string SubscriptionPropertyFilterPrefix = "filter.";
2121
internal const string SubscriptionPropertyMatchUnfiltered = "match-unfiltered";
2222

23+
internal const string FilterNotSupported = "Broker does not support filtering. " +
24+
"You need RabbitMQ 3.13.0 or later and" +
25+
"the stream_filtering feature flag enabled.";
26+
2327
internal static int RandomShort()
2428
{
2529
return Random.Shared.Next(500, 1500);

RabbitMQ.Stream.Client/RawConsumer.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ internal void Validate()
8282

8383
if (IsFiltering && !AvailableFeaturesSingleton.Instance.PublishFilter)
8484
{
85-
throw new UnsupportedOperationException("Broker does not support filtering. You need " +
86-
"RabbitMQ 3.13.0 or later and " +
87-
"the stream_filtering feature flag enabled.");
85+
throw new UnsupportedOperationException(Consts.FilterNotSupported);
8886
}
8987

9088
switch (ConsumerFilter)

RabbitMQ.Stream.Client/RawProducer.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ internal void Validate()
4444
{
4545
if (Filter is { FilterValue: not null } && !AvailableFeaturesSingleton.Instance.PublishFilter)
4646
{
47-
throw new UnsupportedOperationException("Broker does not support filtering. " +
48-
"You need RabbitMQ 3.13.0 or later and" +
49-
"the stream_filtering feature flag enabled.");
47+
throw new UnsupportedOperationException(Consts.FilterNotSupported);
5048
}
5149
}
5250
}

docs/StreamFilter/StreamFilter/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
Server Side Filter Example
22
--------------------------
33

4+
WARNING: Filtering requires *RabbitMQ 3.13* or more and the stream_filter feature flag enabled.
5+
6+
47
This example shows how to use the server side filter to filter the data on the server side.
58

9+
610
### Running the Producer
711

812
```

docs/asciidoc/advanced-topics.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
==== Filtering
66

7-
WARNING: Filtering requires *RabbitMQ 3.13* or more.
7+
WARNING: Filtering requires *RabbitMQ 3.13* or more and the stream_filter feature flag enabled.
88

99
RabbitMQ Stream provides a server-side filtering feature that avoids reading all the messages of a stream and filtering only on the client side.
1010
This helps to save network bandwidth when a consuming application needs only a subset of messages, e.g. the messages from a given geographical region.

0 commit comments

Comments
 (0)