Skip to content

Commit 0b7dfd9

Browse files
committed
self-review 3
1 parent 806b6d2 commit 0b7dfd9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/io/nats/client/impl/NatsConsumerContext.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ private void checkNotPinned(String label) throws IOException {
153153
}
154154
}
155155
}
156+
156157
private NatsMessageConsumerBase trackConsume(NatsMessageConsumerBase con) {
157158
lastConsumer.set(con);
158159
return con;
@@ -221,6 +222,7 @@ public Message next(long maxWaitMillis) throws IOException, InterruptedException
221222
try {
222223
stateLock.lock();
223224
checkState();
225+
checkNotPinned("Next");
224226

225227
try {
226228
long inactiveThreshold = maxWaitMillis * 110 / 100; // 10% longer than the wait

0 commit comments

Comments
 (0)