Skip to content

Commit

Permalink
Add missed CollectionUtils in BlockQueueConsumer
Browse files Browse the repository at this point in the history
  • Loading branch information
artembilan committed Jan 9, 2024
1 parent 02db80b commit aa46e3c
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.OptionalLong;
import java.util.Set;
import java.util.concurrent.BlockingQueue;
Expand Down Expand Up @@ -66,6 +67,7 @@
import org.springframework.lang.Nullable;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.backoff.BackOffExecution;

Expand Down Expand Up @@ -294,7 +296,7 @@ public BlockingQueueConsumer(ConnectionFactory connectionFactory,
this.transactional = transactional;
this.prefetchCount = prefetchCount;
this.defaultRequeueRejected = defaultRequeueRejected;
if (consumerArgs != null && consumerArgs.size() > 0) {
if (!CollectionUtils.isEmpty(consumerArgs)) {
this.consumerArgs.putAll(consumerArgs);
}
this.noLocal = noLocal;
Expand All @@ -309,8 +311,8 @@ public Channel getChannel() {

public Collection<String> getConsumerTags() {
return this.consumers.values().stream()
.map(c -> c.getConsumerTag())
.filter(tag -> tag != null)
.map(DefaultConsumer::getConsumerTag)
.filter(Objects::nonNull)
.collect(Collectors.toList());
}

Expand Down

0 comments on commit aa46e3c

Please sign in to comment.