Embedded ActiveMQ Artemis broker shutdown with AMQ222010 when loses connection to the database

Solution Verified - Updated -

Issue

Embedded Artemis Server will automatically shutdown if the JDBC connection between the JBoss EAP instance and the database is lost even once due to the following reasons:

  • if the JDBC connection pool is exhausted during EAP startup

    10:12:31,872 WARN  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 82) AMQ222010: Critical IO Error, shutting down the server. file=NULL, message=Failed to start JDBC Driver: java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:jboss/datasources/PostgresDS
    
  • if the database is restarted after EAP instance is started

    10:15:30,674 WARN  [org.apache.activemq.artemis.core.server] (Thread-9 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$6@17209ce7)) AMQ222010: Critical IO Error, shutting down the server. file=NULL, message=Critical IO Error.  Failed to process JDBC Record statements: java.sql.BatchUpdateException: Batch entry 0 INSERT INTO messages(id,recordType,compactCount,txId,userRecordType,variableSize,record,txDataSize,txData,txCheckNoRecords,seq) VALUES (***,***,***,***,***,***,***,***,***,***,***) was aborted: FATAL: terminating connection due to administrator command  Call getNextException to see other errors in the batch.
    
  • if the frequency of accessing the Embedded ActiveMQ Artemis broker exceeds idle_in_transaction_session_timeout in postgresql.conf then the JDBC connection is closed by the PostgreSQL

    10:17:38,912 WARN  [org.apache.activemq.artemis.core.server] (Thread-0 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$6@12f0e0f8)) AMQ222010: Critical IO Error, shutting down the server. file=NULL, message=Critical IO Error.  Failed to process JDBC Record statements: java.sql.BatchUpdateException: Batch entry 0 INSERT INTO messages(id,recordType,compactCount,txId,userRecordType,variableSize,record,txDataSize,txData,txCheckNoRecords,seq) VALUES (***,***,***,***,***,***,***,***,***,***,***) was aborted: FATAL: terminating connection due to idle-in-transaction timeout  Call getNextException to see other errors in the batch.
    

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.1
    • 7.2
    • 7.3
  • Messaging JDBC Persistence Store

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content