Examples of KahaDBStore


Examples of org.apache.activemq.store.kahadb.KahaDBStore

        return broker;
    }

    protected void configurePersistenceAdapter(BrokerService broker) throws IOException {
        File dataFileDir = new File("target/test-amq-data/kahadb/" + broker.getBrokerName());
        KahaDBStore kaha = new KahaDBStore();
        kaha.setDirectory(dataFileDir);
        broker.setPersistenceAdapter(kaha);
    }
View Full Code Here

Examples of org.apache.activemq.store.kahadb.KahaDBStore

        final BrokerService master = new BrokerService();
        master.setBrokerName("master");
        master.setPersistent(false);
        master.addConnector("tcp://localhost:0");

        KahaDBStore kaha = new KahaDBStore();
        kaha.setDirectory(new File("target/activemq-data/kahadb"));
        kaha.deleteAllMessages();
        master.setPersistenceAdapter(kaha);

        this.master = master;
    }
View Full Code Here

Examples of org.apache.activemq.store.kahadb.KahaDBStore

        URI masterUri = master.getTransportConnectors().get(0).getConnectUri();
        slave.setMasterConnectorURI(masterUri.toString());
        slave.setUseJmx(false);
        slave.getManagementContext().setCreateConnector(false);

        KahaDBStore kaha = new KahaDBStore();
        kaha.setDirectory(new File("target/activemq-data/kahadb"));
        slave.setPersistenceAdapter(kaha);

        this.slave = slave;
    }
View Full Code Here

Examples of org.apache.activemq.store.kahadb.KahaDBStore

        answer.setBrokerName(BROKER_A1_NAME);

        File directory = new File(BROKER_A_DIRECTORY);
        IOHelper.deleteChildren(directory);

        KahaDBStore kaha = new KahaDBStore();
        kaha.setDirectory(directory);
        answer.setPersistent(true);
        answer.setPersistenceAdapter(kaha);

        NetworkConnector network = answer.addNetworkConnector("masterslave:(" + BROKER_B1_BIND_ADDRESS + "," + BROKER_B2_BIND_ADDRESS + ")?useExponentialBackOff=false&discovered.randomize=true&discovered.maxReconnectAttempts=0");
        network.setDuplex(false);
View Full Code Here

Examples of org.apache.activemq.store.kahadb.KahaDBStore

        answer.setUseJmx(false);
        answer.setBrokerName(BROKER_A2_NAME);

        File directory = new File(BROKER_A_DIRECTORY);

        KahaDBStore kaha = new KahaDBStore();
        kaha.setDirectory(directory);
        answer.setPersistent(true);
        answer.setPersistenceAdapter(kaha);

        // it is possible to *replace* the default implied failover options  via..
        NetworkConnector network = answer.addNetworkConnector("masterslave:(" + BROKER_B1_BIND_ADDRESS + "," + BROKER_B2_BIND_ADDRESS + ")");
View Full Code Here

Examples of org.apache.activemq.store.kahadb.KahaDBStore

        answer.setBrokerName(BROKER_B1_NAME);

        File directory = new File(BROKER_B_DIRECTORY);
        IOHelper.deleteChildren(directory);

        KahaDBStore kaha = new KahaDBStore();
        kaha.setDirectory(directory);
        answer.setPersistent(true);
        answer.setPersistenceAdapter(kaha);

        NetworkConnector network = answer.addNetworkConnector("masterslave:(" + BROKER_A1_BIND_ADDRESS + "," + BROKER_A2_BIND_ADDRESS + ")");
        network.setDuplex(false);
View Full Code Here

Examples of org.apache.activemq.store.kahadb.KahaDBStore

        answer.setUseJmx(false);
        answer.setBrokerName(BROKER_B2_NAME);

        File directory = new File(BROKER_B_DIRECTORY);

        KahaDBStore kaha = new KahaDBStore();
        kaha.setDirectory(directory);
        answer.setPersistent(true);
        answer.setPersistenceAdapter(kaha);

        NetworkConnector network = answer.addNetworkConnector("masterslave:(" + BROKER_A1_BIND_ADDRESS + "," + BROKER_A2_BIND_ADDRESS + ")");
        network.setDuplex(false);
View Full Code Here

Examples of org.apache.activemq.store.kahadb.KahaDBStore

        MessageProducer p = s.createProducer(new ActiveMQQueue("Tx"));
        p.send(s.createTextMessage("aa"));

        // kill journal without commit
        KahaDBPersistenceAdapter pa = (KahaDBPersistenceAdapter) broker.getPersistenceAdapter();
        KahaDBStore store = pa.getStore();

        assertNotNull("last tx location is present " + store.getFirstInProgressTxLocation());

        // test hack, close the journal to ensure no further journal updates when broker stops
        // mimic kill -9 in terms of no normal shutdown sequence
        store.getJournal().close();
        try {
            store.close();
        } catch (Exception expectedLotsAsJournalBorked) {
        }

        broker.stop();
        broker.waitUntilStopped();

        // restart with recovery
        broker = createAndStartBroker(false);

        pa = (KahaDBPersistenceAdapter) broker.getPersistenceAdapter();
        store = pa.getStore();

        // inflight non xa tx should be rolledback on recovery
        assertNull("in progress tx location is present ", store.getFirstInProgressTxLocation());

    }
View Full Code Here

Examples of org.apache.activemq.store.kahadb.KahaDBStore

        return answer;
    }
   
    protected void configureBroker(BrokerService answer,boolean deleteStore) throws Exception{
        answer.setDeleteAllMessagesOnStartup(deleteStore);
        KahaDBStore kaha = new KahaDBStore();
        //kaha.setConcurrentStoreAndDispatchTopics(false);
        File directory = new File("target/activemq-data/kahadb");
        if (deleteStore) {
            IOHelper.deleteChildren(directory);
        }
        kaha.setDirectory(directory);
        //kaha.setMaxAsyncJobs(10);
       
        answer.setPersistenceAdapter(kaha);
        answer.addConnector(bindAddress);
        answer.setUseShutdownHook(false);
View Full Code Here

Examples of org.apache.activemq.store.kahadb.KahaDBStore

        return broker;
    }
   
    protected BrokerService createRestartedBroker() throws Exception {
        BrokerService broker = new BrokerService();
        KahaDBStore kaha = new KahaDBStore();
        kaha.setDirectory(new File("target/activemq-data/leveldb"));
        broker.setPersistenceAdapter(kaha);
        return broker;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.