From 4a41c96b422af7b43b40dbfea506c44ed802af6f Mon Sep 17 00:00:00 2001 From: scottf Date: Mon, 8 Jul 2024 06:54:40 -0400 Subject: [PATCH] Add filtering to KV keys methods remove unnecessary optimization --- src/main/java/io/nats/client/impl/NatsFeatureBase.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/nats/client/impl/NatsFeatureBase.java b/src/main/java/io/nats/client/impl/NatsFeatureBase.java index e8c6f197a..cc2b9b38b 100644 --- a/src/main/java/io/nats/client/impl/NatsFeatureBase.java +++ b/src/main/java/io/nats/client/impl/NatsFeatureBase.java @@ -79,14 +79,8 @@ protected void visitSubject(List subjects, DeliverPolicy deliverPolicy, ConsumerConfiguration.Builder ccb = ConsumerConfiguration.builder() .ackPolicy(AckPolicy.None) .deliverPolicy(deliverPolicy) - .headersOnly(headersOnly); - - if (subjects.size() == 1) { - ccb.filterSubject(subjects.get(0)); - } - else { - ccb.filterSubjects(subjects); - } + .headersOnly(headersOnly) + .filterSubjects(subjects); PushSubscribeOptions pso = PushSubscribeOptions.builder() .stream(streamName)