use of org.apache.activemq.util.DefaultIOExceptionHandler in project activemq-artemis by apache.
the class DbRestartJDBCQueueTest method setUp.
@Override
protected void setUp() throws Exception {
setAutoFail(true);
topic = false;
verbose = true;
// startup db
sharedDs = (EmbeddedDataSource) DataSourceServiceSupport.createDataSource(IOHelper.getDefaultDataDirectory());
broker = new BrokerService();
DefaultIOExceptionHandler handler = new DefaultIOExceptionHandler();
handler.setIgnoreSQLExceptions(false);
handler.setStopStartConnectors(true);
broker.setIoExceptionHandler(handler);
broker.addConnector("tcp://localhost:0");
broker.setUseJmx(false);
broker.setPersistent(true);
broker.setDeleteAllMessagesOnStartup(true);
JDBCPersistenceAdapter persistenceAdapter = new JDBCPersistenceAdapter();
persistenceAdapter.setDataSource(sharedDs);
persistenceAdapter.setUseLock(false);
persistenceAdapter.setLockKeepAlivePeriod(500);
persistenceAdapter.getLocker().setLockAcquireSleepInterval(500);
broker.setPersistenceAdapter(persistenceAdapter);
broker.start();
super.setUp();
}
use of org.apache.activemq.util.DefaultIOExceptionHandler in project activemq-artemis by apache.
the class JDBCQueueMasterSlaveTest method configureBroker.
protected void configureBroker(BrokerService brokerService) {
DefaultIOExceptionHandler stopBrokerOnStoreException = new DefaultIOExceptionHandler();
// we want any store io exception to stop the broker
stopBrokerOnStoreException.setIgnoreSQLExceptions(false);
brokerService.setIoExceptionHandler(stopBrokerOnStoreException);
}
use of org.apache.activemq.util.DefaultIOExceptionHandler in project activemq-artemis by apache.
the class kahaDbJdbcLeaseQueueMasterSlaveTest method configureBroker.
protected void configureBroker(BrokerService brokerService) {
DefaultIOExceptionHandler stopBrokerOnStoreException = new DefaultIOExceptionHandler();
// we want any store io exception to stop the broker
stopBrokerOnStoreException.setIgnoreSQLExceptions(false);
brokerService.setIoExceptionHandler(stopBrokerOnStoreException);
}
Aggregations