Package org.apache.activemq.broker

Examples of org.apache.activemq.broker.BrokerService.waitUntilStopped()


        KahaDBStore store = new KahaDBStore();
        store.setDirectory(new File("target/activemq-data/kahadb"));
        bs.setPersistenceAdapter(store);
        bs.deleteAllMessages();
        bs.start();
        bs.waitUntilStopped();
    }
}
View Full Code Here


        broker.getPersistenceAdapter().deleteAllMessages();
        broker.setUseJmx(false);
        broker.start();
        broker.waitUntilStarted();
        broker.stop();
        broker.waitUntilStopped();
    }

    /**
     * Send message and consume message, JMS session is not transacted
     *
 
View Full Code Here

            assertEquals("check message received", MSG_TEXT, messageReceived.getText());
        } finally {
            c1.close();
            broker.stop();
            broker.waitUntilStopped();
        }
    }

    private BrokerService createBrokerService() throws IOException {
        BrokerService broker = new BrokerService();
View Full Code Here

        KahaDBStore store = new KahaDBStore();
        store.setDirectory(new File("target/activemq-data/kahadb"));
        bs.setPersistenceAdapter(store);
        bs.deleteAllMessages();
        bs.start();
        bs.waitUntilStopped();
    }
}
View Full Code Here

            assertEquals(latch.getCount(), NUMBER);
            latch.await(30, TimeUnit.SECONDS);

            connection.close();
            broker.stop();
            broker.waitUntilStopped();

            assertEquals(0, latch.getCount());
        }
    }
}
View Full Code Here

            return;
        }
        try {
            LOG.info("Stopping broker " + pid);
            broker.stop();
            broker.waitUntilStopped();
        } catch (Exception e) {
            LOG.error("Exception on stopping broker", e);
        }
    }
View Full Code Here

    }

    protected void stopBroker(String name) throws Exception {
        BrokerService broker = brokers.remove(name);
        broker.stop();
        broker.waitUntilStopped();
    }

    protected BrokerService removeBroker(String name) {
        return brokers.remove(name);
    }
View Full Code Here

        assertTrue("Threads are leaking: " + ThreadExplorer.show("active sleep") + ", threadCount=" +threadCountAfterStart + " threadCountAfterSleep=" + threadCountAfterSleep,
                threadCountAfterSleep < threadCountAfterStart + 8);

        connection.close();
        broker.stop();
        broker.waitUntilStopped();

        // testNoDanglingThreadsAfterStop with tcp transport
        broker = new BrokerService();
        broker.setSchedulerSupport(true);
        broker.setDedicatedTaskRunner(true);
View Full Code Here

        cf = new ActiveMQConnectionFactory("tcp://localhost:61616?wireFormat.maxInactivityDuration=1000&wireFormat.maxInactivityDurationInitalDelay=1000");
        connection = cf.createConnection("system", "manager");
        connection.start();
        connection.close();
        broker.stop();
        broker.waitUntilStopped();

        // let it settle
        TimeUnit.SECONDS.sleep(5);       

        // get final threads but filter out any daemon threads that the JVM may have created.
View Full Code Here

                t.printStackTrace();
            }
            try {
                if (brokerService2 != null) {
                    brokerService2.stop();
                    brokerService2.waitUntilStopped();
                }
            } catch (final Throwable t) {
                t.printStackTrace();
            }
        }
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.