Package org.apache.activemq.broker

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


        Connection connection = cf.createConnection();
        connection.setClientID("test");
        connection.start();
        producerSomeMessages(connection, 1000);
        connection.close();
        broker.stop();
    }

    private void producerSomeMessages(Connection connection, int numToSend) throws Exception {
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Topic topic = session.createTopic("test.topic");
View Full Code Here


                assertNotNull(msg);
            }
            LOG.info("Consumed " + count + " from topic");
            connection.close();
           
            broker.stop();
        }
    }
}
View Full Code Here

            ex.printStackTrace();
        }

        stompConnection.sendFrame("DISCONNECT\n\n");
        stompConnection.close();
        broker.stop();

        LOG.info("Total messages received: " + messagesCount);
        assertTrue("Messages received after connection loss: " + messagesCount, messagesCount >= 2000);

        // The first ack messages has no chance complete, so we receiving more
View Full Code Here

        Message message = session.createTextMessage("Test message");
        producer.send(message);
        Message msg = consumer.receive(2000);
        assertNotNull(msg);

        bs1.stop();
        bs1.waitUntilStopped();

        bs2 = createBroker("bs2", secondTcpUri);
        bs2.start();
View Full Code Here

        bs2.waitUntilStarted();

        TimeUnit.SECONDS.sleep(4);

        LOG.info("stopping brokerService 1");
        bs1.stop();
        bs1.waitUntilStopped();

        producer.send(message);
        msg = consumer.receive(4000);
        assertNotNull(msg);
View Full Code Here

        broker.addConnector(getBindLocation());
        broker.start();
        broker.waitUntilStarted();
        Thread.sleep(2000);
        //System.in.read();
        broker.stop();
        broker.waitUntilStopped();
    }
   
}
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();
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();

        // must only be called when all brokers and connections are done!
        DefaultThreadPools.shutdown();
View Full Code Here

            assertTrue(broker.getSystemUsage().getStoreUsage().getStore() instanceof JournalPersistenceAdapter);

            LOG.info("Success");
        } finally {
            if (broker != null) {
                broker.stop();
            }
        }
    }

    /*
 
View Full Code Here

            assertTrue("Should have created a DefaultWireFormat", ((JDBCPersistenceAdapter)adapter).getWireFormat() instanceof ObjectStreamWireFormat);

            LOG.info("Success");
        } finally {
            if (broker != null) {
                broker.stop();
            }
        }
    }

    public void testJdbcLockConfigOverride() throws Exception {
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.