[ https://issues.apache.org/jira/browse/AMQ-9118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17616401#comment-17616401 ]
Gordon commented on AMQ-9118: ----------------------------- Example client application - MqTest2.java. Connection to the database can be emulated using "socat" proxy: socat TCP-LISTEN:15432,fork TCP:127.0.0.1:5432 where 5432 - postgresql port, 15432 - port broker connects to. Killing socat kills connection to DB. > jms consumer may hang if jms.prefetchPolicy.all=0 > -------------------------------------------------- > > Key: AMQ-9118 > URL: https://issues.apache.org/jira/browse/AMQ-9118 > Project: ActiveMQ > Issue Type: Bug > Components: JMS client > Affects Versions: 5.16.5 > Reporter: Gordon > Priority: Major > Attachments: MqTest2.java > > > > I have an activemq broker using jdbc datasource and client application using > failover tcp connection with parameter jms.prefetchPolicy.all=0. If > connection to database is not stable, client may hang indefinitely. > This happens in this scenario: > # There is a jms connection using failover tcp transport. Session is using > CLIENT_ACKNOWLEDGE. > # Jms consumer calls receive - it sends pull message request to the broker. > # broker sends message to the consumer. > # client application starts processing of the message. > # network failure, broker looses connection to the database. > # broker stops tcp transport. > # client application finish processing of the message, but jms consumer > fails to acknowledge message because broker is not available. > # network restores, broker restarts tcp transport. > # jms consumer restores connection to the broker and sends pull message > request. > # Broker sends the SAME message to the consumer because it was not > acknowledged. > # ActiveMQMessageConsumer detects message as duplicate and DROPS it, writing > "suppressing duplicate delivery on connection, poison acking: > MessageDispatch" in the log. > # consumer continue to wait a message. It hangs forever. > > This issue happens when jms.prefetchPolicy.all=0 - when client pulls messages > from the broker instead of the broker pushing them to the client. -- This message was sent by Atlassian Jira (v8.20.10#820010)