Kurt Roekle created AMQ-5057:
--------------------------------
Summary: JDBC datastore unable to process messages after exception
Key: AMQ-5057
URL: https://issues.apache.org/jira/browse/AMQ-5057
Project: ActiveMQ
Issue Type: Bug
Components: Message Store
Affects Versions: 5.9.0
Environment: RHEL, MySql 5.5, mysql connector 5.1.17
Reporter: Kurt Roekle
When using the jdbcPersistenceAdapter and an exception is thrown in the store,
then no further messages can be consumed until the broker is restarted.
I our case we were trying to store a message that was larger than what
max_allowed_packet was set to in mysql (though I would assume other types of
exceptions might cause the same issue). Valid messages sent after the
exception occurred were stored in the database, but did not show up in the UI
and could not be consumed. After a restart of the broker, the messages showed
up in the UI and were able to be consumed.
<persistenceAdapter>
<jdbcPersistenceAdapter
dataDirectory="${activemq.base}/activemq-data" dataSource="#mysql-ds"/>
</persistenceAdapter>
<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url"
value="jdbc:mysql://db3/activemq59?relaxAutoCommit=true&autoReconnect=true"/>
<property name="username" value="activemq"/>
<property name="password" value="xxxxx"/>
<property name="maxActive" value="400"/>
<property name="maxIdle" value="10"/>
<property name="minIdle" value="5"/>
<property name="testOnBorrow" value="true"/>
<property name="validationQuery" value="select 1"/>
<property name="poolPreparedStatements" value="true"/>
<property name="maxOpenPreparedStatements" value="50"/>
</bean>
2014-02-14 13:29:28,978 | WARN | Commit failed: Packet for query is too large
(105132838 > 25165824). You can change this value on the server by setting the
max_allowed_packet' variable. |
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter | ActiveMQ Transport:
tcp:///192.168.101.223:60777@61616
java.sql.BatchUpdateException: Packet for query is too large (105132838 >
25165824). You can change this value on the server by setting the
max_allowed_packet' variable.
at
com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2024)
at
com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1449)
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:106)
at
org.apache.activemq.store.jdbc.TransactionContext.executeBatch(TransactionContext.java:84)
at
org.apache.activemq.store.jdbc.TransactionContext.commit(TransactionContext.java:171)
at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.commitTransaction(JDBCPersistenceAdapter.java:516)
at
org.apache.activemq.store.memory.MemoryTransactionStore$Tx.commit(MemoryTransactionStore.java:110)
at
org.apache.activemq.store.memory.MemoryTransactionStore.commit(MemoryTransactionStore.java:259)
at
org.apache.activemq.transaction.LocalTransaction.commit(LocalTransaction.java:70)
at
org.apache.activemq.broker.TransactionBroker.commitTransaction(TransactionBroker.java:253)
at
org.apache.activemq.broker.MutableBrokerFilter.commitTransaction(MutableBrokerFilter.java:112)
at
org.apache.activemq.broker.TransportConnection.processCommitTransactionOnePhase(TransportConnection.java:424)
at
org.apache.activemq.command.TransactionInfo.visit(TransactionInfo.java:100)
at
org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:292)
at
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:149)
at
org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)
at
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
at
org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:270)
at
org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:214)
at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196)
at java.lang.Thread.run(Thread.java:724)
Caused by: com.mysql.jdbc.PacketTooBigException: Packet for query is too large
(105132838 > 25165824). You can change this value on the server by setting the
max_allowed_packet' variable.
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3279)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1971)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2625)
at
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119)
at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2415)
at
com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1976)
... 24 more
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)