-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Description
Affects: <Spring Framework version>
5.2.25
First, a little background:
For a variety of reasons, we discovered the issue after upgrading the spring upgrade from 3.0.7 to 5.2.25.
My puzzle scenario is as follows:
Found in our tests
- A client connects to ActiveMQ
- The ActiveMQ service stopped abnormally and was restored after about 5 minutes
- After recovery, the default message listener log displays the following information:
DefaultMessageListenerContainer - Could not refresh JMS Connection for destination 'xxx' - retrying using FixedBackOff{interval=5000, currentAttempts=20, maxAttempts=unlimited}. Cause: The JMS connection has failed: java.io.EOFException - After this, the client reconnects N times, but still fails
After investigation, we learned that
Spring's 5.2.25 version,org.springframework.jms.connection.SingleConnectionFactory.initConnection() for the connection of assignment problem,org.springframework.jms.listener.DefaultMessageListenerContainer.refreshConnectionUntilSuccessful() can't get out of the while loop because an exception in org.springframework.jms.connection.SingleConnectionFactory.prepareConnection(Connection) causes the connection to become non-null, causes org.springframework.jms.connection.SingleConnectionFactory.getConnection() to not get a new link, and causes org.springframework.jms.listener.DefaultMessageListenerContainer.refreshConnectionUntilSuccessful() to not get out of the while loop
One more question:
The problem is very similar to this problem,
DefaultMessageListenerContainer fails to reconnect to ActiveMQ broker #23058
But #23058 was fixed as early as 2019, and spring 5.2.25 is the version released in July 2023, why this issue is not fixed in version 5.2.25, which makes me confused
(My English is very poor. I hope you can understand it)
Sorry, github is infrequent and may not be able to see and respond to your messages in a timely manner
You can contact me by email. Thank you
my email: echo.t1@qq.com
ActiveMQ version:5.5.1
jms version:5.2.25