Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-2823

Improve JDBC connection management

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.16.0
    • Broker
    • None

    Description

      I have a case where the whole clustering reliability and HA must rely on HA capabilities of clustered database, and running on top of application server is not an option.

      The current JDBC store implementation is rather bare bones on the connection management side. JDBC driver is used directly with no management layer. At startup, the broker just opens couple of direct connections to database and expects them to be available forever. This is something that cannot be expected in HA production environment. So, similarly to the discussion linked below, in our case we lose the db connection after one hour, and all the brokers need to be restared to get new connections:

      http://activemq.2283324.n4.nabble.com/Artemis-does-not-reconnect-to-MySQL-after-connection-timeout-td4751956.html 

      This is something that could be resolved by simply using JDBC4 isValid checks, but proper connection handling and pooling through datasource would be preferrable.

      I have implemented a solution for this by using DBCP2 datasource. Our test cluster has been successfully running this forked version since the release of Artemis 2.13.0. I will prepare of pull request if this is seen to be something that can be useful.

      Attachments

        Issue Links

          Activity

            People

              nigrofranz Francesco Nigro
              mikkommku Mikko
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 16h 20m
                  16h 20m