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.
1 parent ec0677b commit 091d3e4Copy full SHA for 091d3e4
src/main/java/com/amazon/sqs/javamessaging/SQSMessageConsumerPrefetch.java
@@ -570,9 +570,14 @@ private javax.jms.Message messageHandler(MessageManager messageManager) throws J
570
}
571
572
private boolean cannotDeliver() throws JMSException {
573
- if (isClosed() || !running) {
574
- return true;
+ if (!running) {
+ return true;
575
576
+
577
+ if (isClosed()) {
578
+ throw new JMSException("Cannot receive messages when the consumer is closed");
579
+ }
580
581
if (messageListener != null) {
582
throw new JMSException("Cannot receive messages synchronously after a message listener is set");
583
0 commit comments