Skip to content

Commit 0ac76af

Browse files
committed
Use & in AMQP filter expressions
Pre-release versions of RabbitMQ 4.1 incorrectly used a $ sign where & should have been used. See rabbitmq/rabbitmq-server#12919
1 parent 9975fb8 commit 0ac76af

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ Note that this is a separate feature from stream filtering of the Stream protoco
8080
1. When publishing, you can specify application properties. If multiple values are provided, one of them is used for each message
8181
(so you get a mix of messages with different values). For example, `--amqp-app-property key=foo,bar,baz` will publish some messages
8282
with `key=foo`, some with `key=bar` and some with `key=baz` (in roughly equal proportions).
83-
2. When consuming, you can apply a filter, for example, `--amqp-app-property-filter key=$p:ba` will tell RabbitMQ to only deliver
84-
messages where the `key` property starts with `ba` (`$p:` means that what follows is a prefix), so it'll return roughly 66%
83+
2. When consuming, you can apply a filter, for example, `--amqp-app-property-filter key=&p:ba` will tell RabbitMQ to only deliver
84+
messages where the `key` property starts with `ba` (`&p:` means that what follows is a prefix), so it'll return roughly 66%
8585
of the messages in the stream. You can filter on properties (eg. `subject`) or application properties.
8686

8787
Here's a full example, where we can see this in action:
@@ -129,7 +129,7 @@ messages published with perf-test can be consumed by `omq` or vice versa, and th
129129

130130
```
131131
--amqp-app-property stringArray AMQP application properties, eg. key1=val1,val2
132-
--amqp-app-property-filter stringArray AMQP application property filters, eg. key1=$p:prefix
132+
--amqp-app-property-filter stringArray AMQP application property filters, eg. key1=&p:prefix
133133
--binding-key string AMQP 1.0 consumer binding key
134134
--amqp-property-filter stringArray AMQP property filters, eg. subject=foo
135135
--amqp-reject-rate int Rate of messages to reject (0-100%)

cmd/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ func RootCmd() *cobra.Command {
104104
amqpConsumerFlags.IntVar(&cfg.Amqp.ReleaseRate, "amqp-release-rate", 0,
105105
"Rate of messages to release without accepting (0-100%)")
106106
amqpConsumerFlags.StringArrayVar(&amqpAppPropertyFilters, "amqp-app-property-filter", []string{},
107-
"AMQP application property filters, eg. key1=$p:prefix")
107+
"AMQP application property filters, eg. key1=&p:prefix")
108108
amqpConsumerFlags.StringArrayVar(&amqpPropertyFilters, "amqp-property-filter", []string{},
109-
"AMQP property filters, eg. key1=$p:prefix")
109+
"AMQP property filters, eg. key1=&p:prefix")
110110

111111
amqp_amqp = &cobra.Command{
112112
Use: "amqp-amqp",

main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ var _ = Describe("OMQ CLI", func() {
159159
"--publish-to=/queues/stream-with-app-property-filters",
160160
"--consume-from=/queues/stream-with-app-property-filters",
161161
"--amqp-app-property", "key1=foo,bar,baz",
162-
"--amqp-app-property-filter", "key1=$p:ba",
162+
"--amqp-app-property-filter", "key1=&p:ba",
163163
"--queues=stream",
164164
"--cleanup-queues=true",
165165
"--time=2s",

0 commit comments

Comments
 (0)