Package org.apache.activemq.store.kahadb

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


public class StoreQueueCursorKahaDBNoDuplicateTest extends StoreQueueCursorNoDuplicateTest {

    @Override
    protected BrokerService createBroker() throws Exception {
        BrokerService broker = super.createBroker();
        PersistenceAdapter persistenceAdapter = new KahaDBStore();
        persistenceAdapter.setDirectory(new File("target/activemq-data/kahadb"));     
        broker.setPersistenceAdapter(persistenceAdapter);
        return broker;
    }
View Full Code Here


        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);
        kaha.deleteAllMessages();
        broker.setPersistenceAdapter(kaha);
    }
View Full Code Here

        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

        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

        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

        return answer;
    }

    protected void configureBroker(BrokerService answer) throws Exception {
        File dataFileDir = new File("target/test-amq-data/bugs/AMQ2356/kahadb");
        KahaDBStore kaha = new KahaDBStore();
        kaha.setDirectory(dataFileDir);
        answer.setUseJmx(false);
        // Setup a destination policy where it takes only 1 message at a time.
        PolicyMap policyMap = new PolicyMap();
        PolicyEntry policy = new PolicyEntry();
        policy.setOptimizedDispatch(true);
View Full Code Here

        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

    @Override
    protected BrokerService createBroker() throws Exception {
        File dataFileDir = new File("target/test-amq-2512/datadb");
        IOHelper.mkdirs(dataFileDir);
        IOHelper.deleteChildren(dataFileDir);
        KahaDBStore kaha = new KahaDBStore();
        kaha.setDirectory(dataFileDir);
        BrokerService answer = new BrokerService();
        answer.setPersistenceAdapter(kaha);
     
        kaha.setEnableJournalDiskSyncs(false);
        //kaha.setIndexCacheSize(10);
        answer.setDataDirectoryFile(dataFileDir);
        answer.setUseJmx(false);
        answer.addConnector(bindAddress);
        return answer;
View Full Code Here

        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.getInProgressTxLocationRange()[1]);

        // 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.getInProgressTxLocationRange()[0]);

    }
View Full Code Here

    protected int messageSize = 1024 * 4;

    protected BrokerService createBroker() throws Exception {
        BrokerService broker = new BrokerService();
        KahaDBStore kaha = new KahaDBStore();
        kaha.setDirectory(new File("target/activemq-data/kahadb"));
        // kaha.deleteAllMessages();
        broker.setPersistenceAdapter(kaha);
        broker.addConnector("tcp://localhost:0");
        return broker;
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.store.kahadb.KahaDBStore$KahaDBMessageStore

Copyright © 2018 www.massapicom. 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.