From 9795119cb7aade61946ba8f6b61da17fa89c880a Mon Sep 17 00:00:00 2001 From: Andrey Yegorov Date: Fri, 3 May 2024 16:46:38 -0700 Subject: [PATCH] similarly iterator(). not sure what's drainTo's behavior is --- .../pulsar/jms/MessagePriorityGrowableArrayBlockingQueue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulsar-jms/src/main/java/com/datastax/oss/pulsar/jms/MessagePriorityGrowableArrayBlockingQueue.java b/pulsar-jms/src/main/java/com/datastax/oss/pulsar/jms/MessagePriorityGrowableArrayBlockingQueue.java index dc589e84..9e20d640 100644 --- a/pulsar-jms/src/main/java/com/datastax/oss/pulsar/jms/MessagePriorityGrowableArrayBlockingQueue.java +++ b/pulsar-jms/src/main/java/com/datastax/oss/pulsar/jms/MessagePriorityGrowableArrayBlockingQueue.java @@ -131,7 +131,7 @@ public int size() { @Override public Iterator iterator() { - return queue.iterator(); + return queue.stream().sorted(comparator).iterator(); } @Override