AMQ 6.3 with Oracle JDBC persistence doesn't rollback the incumbent message if there is a connection reset on the database connection while sending the message.

Solution Verified - Updated -

Issue

  • The AMQ logs show connection reset on the database connection
java.sql.SQLRecoverableException: IO Error: Connection reset
    at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:967)
    at oracle.jdbc.driver.OraclePreparedStatement.executeForRowsWithTimeout(OraclePreparedStatement.java:10932)
    at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:11043)
    at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:244)
    at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
    at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
    at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
    at org.apache.activemq.store.jdbc.TransactionContext.executeBatch(TransactionContext.java:130)
  • This is also reflected in the producer logs
javax.jms.JMSException: IO Error: Connection reset
    at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:54)
    at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1396)
    at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1423)
    at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1320)
    at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1975)
    at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:288)
    at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:223)
    at org.apache.activemq.ActiveMQMessageProducerSupport.send(ActiveMQMessageProducerSupport.java:241)
  • As a result of this, the producer does not get a proper acknowledgment but instead, it gets the exception but the message has already been persisted by the broker.
  • This is a false negative and can result in inconsistencies and duplicate messages if the producer decides to retry on this Exception.

Environment

  • Red Hat AMQ
    • 6.3

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