activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mk666aim <>
Subject Artemis does not reconnect to MySQL after connection timeout
Date Mon, 19 Aug 2019 14:12:01 GMT
We're trying to use MySQL 5.7 backend for JDBC persistent store.
This works fine, until the point where the connection goes stale due to the
server timeout.
This is our current set up in broker.xml:


MySQL default setting of the *wait_timeout* parameter is 8 hours.
We are not able to get Artemis to reconnect again after this timeout is
reached and we were forced to set up a cron-triggered restart to mitigate

Error that we get is as follows:

*The last packet successfully received from the server was 43417 seconds
ago.The last packet sent successfully to the server was 43417 seconds ago,
which is longer than the server configured value of 'wait_timeout'. You
should consider either expiring and/or testing connection validity before
use in your application, increasing the server configured values for client
timeouts, or using the Connector/J connection property 'autoReconnect=true'
to avoid this problem

This issue is easily rectifiable in the old ActiveMQ, as this uses
Spring-cofngiured datasource, e.g.:
    <bean id="mysql-ds" class="org.apache.commons.dbcp2.BasicDataSource"
      <property name="driverClassName" value="com.mysql.cj.jdbc.Driver"/>
      <property name="url"
      <property name="username" value="user"/>
      <property name="password" value="pass"/>
      <property name="poolPreparedStatements" value="true"/>
      <property name="initialSize" value="5"/>
      <property name="maxIdle" value="10"/>
      <property name="maxTotal" value="50"/>
      <property name="removeAbandonedOnMaintenance" value="true"/>
      <property name="removeAbandonedOnBorrow" value="true"/>

The *autoReconnect* / *autoReconnectForPools* parameters to the driver URL
did not make any difference, and in addition they are not actually
recommended by MySQL maintainers.

Sent from:

View raw message