Package org.apache.activemq.store.kahadb

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


        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 policy;
    }

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

        broker = new BrokerService();
        //broker.setDeleteAllMessagesOnStartup(true);
        broker.setPersistent(true);
        broker.setUseJmx(true);

        KahaDBStore kaha = new KahaDBStore();
        kaha.setDirectory(new File("target/activemq-data/kahadb"));
        // The setEnableJournalDiskSyncs(false) setting is a little dangerous right now, as I have not verified
        // what happens if the index is updated but a journal update is lost.
        // Index is going to be in consistent, but can it be repaired?
        kaha.setEnableJournalDiskSyncs(false);
        // Using a bigger journal file size makes he take fewer spikes as it is not switching files as often.
        kaha.setJournalMaxFileLength(1024*1024*100);

        // small batch means more frequent and smaller writes
        kaha.setIndexWriteBatchSize(100);
        // do the index write in a separate thread
        kaha.setEnableIndexWriteAsync(true);

        broker.setPersistenceAdapter(kaha);

        broker.addConnector("tcp://localhost:0").setName("Default");
        broker.start();
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,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

    private BrokerService createBroker() throws Exception {
        BrokerService broker = new BrokerService();
        broker.setBrokerName(brokerName);

        KahaDBStore kaha = new KahaDBStore() {

            @Override
            public void start() throws Exception {
                LOG.info("Test KahaDB class is waiting for signal to complete its start()");
                holdStoreStart.await();
                super.start();
                LOG.info("Test KahaDB class is completed its start()");
            }
        };

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

        broker.setPersistenceAdapter(kaha);
        broker.setUseJmx(true);

        return broker;
View Full Code Here

        session.close();
        con.close();

        PersistenceAdapter persistenceAdapter = broker.getPersistenceAdapter();
        if( persistenceAdapter instanceof KahaDBPersistenceAdapter) {
            final KahaDBStore store = ((KahaDBPersistenceAdapter) persistenceAdapter).getStore();
            LOG.info("Store page count: " + store.getPageFile().getPageCount());
            LOG.info("Store free page count: " + store.getPageFile().getFreePageCount());
            LOG.info("Store page in-use: " + (store.getPageFile().getPageCount() - store.getPageFile().getFreePageCount()));

            assertTrue("no leak of pages, always use just 11", Wait.waitFor(new Wait.Condition() {
                @Override
                public boolean isSatisified() throws Exception {
                    return 11 == store.getPageFile().getPageCount() -
                            store.getPageFile().getFreePageCount();
                }
            }, TimeUnit.SECONDS.toMillis(10)));
        }
    }
View Full Code Here

    protected int messageSize = 1024 * 4;

    @Override
    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

    /**
     * Copied from AmqpTestSupport, modified to use persistence
     */
    public void createBroker(boolean deleteAllMessages) throws Exception {
        KahaDBStore kaha = new KahaDBStore();
        kaha.setDirectory(new File(KAHADB_DIRECTORY));

        brokerService = new BrokerService();
        brokerService.setDeleteAllMessagesOnStartup(deleteAllMessages);
        brokerService.setPersistent(true);
        brokerService.setPersistenceAdapter(kaha);
View Full Code Here

TOP

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

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.