Skip to content

Commit 7c44658

Browse files
committed
Validate stream filter values
1 parent ab240b8 commit 7c44658

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/rabbitmq/client/amqp/impl/AmqpConsumerBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ public Consumer build() {
115115
if (this.messageHandler == null) {
116116
throw new IllegalArgumentException("Message handler cannot be null");
117117
}
118-
119-
// TODO validate stream (filtering) configuration
120-
121118
return this.connection.createConsumer(this);
122119
}
123120

@@ -167,6 +164,9 @@ public StreamOptions offset(String interval) {
167164

168165
@Override
169166
public StreamOptions filterValues(String... values) {
167+
if (values == null || values.length == 0) {
168+
throw new IllegalArgumentException("At least one stream filter value must specified");
169+
}
170170
this.filters.put("rabbitmq:stream-filter", Arrays.asList(values));
171171
return this;
172172
}

0 commit comments

Comments
 (0)