Github user clebertsuconic commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/1434#discussion_r130675636
--- Diff:
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java
---
@@ -717,6 +717,19 @@ public void
recreateConsumerOnServer(ClientConsumerInternal consumerInternal) th
SessionConsumerFlowCreditMessage packet = new
SessionConsumerFlowCreditMessage(getConsumerID(consumerInternal), 1);
sendPacketWithoutLock(sessionChannel, packet);
}
+
+ //force a delivery to avoid a infinite waiting
+ //it can happen when the consumer sends a 'forced delivery' then
+ //waiting forever, while the connection is broken and the server's
+ //'forced delivery' message never gets to consumer. If session
+ //is reconnected, its consumer never knows and stays waiting.
+ //note this message will either be ignored by consumer
(forceDeliveryCount
+ //doesn't match, which is fine) or be caught by consumer
+ //(in which case the consumer will wake up, thus avoid the infinite
waiting).
+ if (isSessionStarted) {
--- End diff --
this should been:
```java
if (isSessionStarted && consumerInternal.getForceDeliveryCount() > 0) {
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---