We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 721cd7d + 091d3e4 commit 04b2881Copy full SHA for 04b2881
src/main/java/com/amazon/sqs/javamessaging/SQSMessageConsumerPrefetch.java
@@ -589,9 +589,14 @@ private javax.jms.Message messageHandler(MessageManager messageManager) throws J
589
}
590
591
private boolean cannotDeliver() throws JMSException {
592
- if (isClosed() || !running) {
593
- return true;
+ if (!running) {
+ return true;
594
595
+
596
+ if (isClosed()) {
597
+ throw new JMSException("Cannot receive messages when the consumer is closed");
598
+ }
599
600
if (messageListener != null) {
601
throw new JMSException("Cannot receive messages synchronously after a message listener is set");
602
0 commit comments