Search in sources :

Example 1 with DefaultIOExceptionHandler

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();
}
Also used : DefaultIOExceptionHandler(org.apache.activemq.util.DefaultIOExceptionHandler) JDBCPersistenceAdapter(org.apache.activemq.store.jdbc.JDBCPersistenceAdapter) BrokerService(org.apache.activemq.broker.BrokerService)

Example 2 with DefaultIOExceptionHandler

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);
}
Also used : DefaultIOExceptionHandler(org.apache.activemq.util.DefaultIOExceptionHandler)

Example 3 with DefaultIOExceptionHandler

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);
}
Also used : DefaultIOExceptionHandler(org.apache.activemq.util.DefaultIOExceptionHandler)

Aggregations

DefaultIOExceptionHandler (org.apache.activemq.util.DefaultIOExceptionHandler)3 BrokerService (org.apache.activemq.broker.BrokerService)1 JDBCPersistenceAdapter (org.apache.activemq.store.jdbc.JDBCPersistenceAdapter)1