Package org.apache.activemq.broker

Examples of org.apache.activemq.broker.BrokerService


 
  @Override @BeforeClass
  protected void setUp() throws Exception {
    super.setUp();
   
    broker = new BrokerService();
    broker.start();
    ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(broker.getVmConnectorURI());
   
    this.context = EasyMock.createMock(Context.class);
    EasyMock.expect(context.lookup("ConnectionFactory")).andReturn(factory).anyTimes();
View Full Code Here


        if (startActiveMq) {
            String dataDir = System.getProperty("falcon.embeddedmq.data", "target/");
            int mqport = Integer.valueOf(System.getProperty("falcon.emeddedmq.port", "61616"));
            LOG.info("Starting activemq at port " + mqport + " with data dir " + dataDir);

            BrokerService broker = new BrokerService();
            broker.setUseJmx(false);
            broker.setDataDirectory(dataDir);
            broker.addConnector("vm://localhost");
            broker.addConnector("tcp://0.0.0.0:" + mqport);
            broker.setSchedulerSupport(true);
            broker.start();
        }

        EmbeddedServer server = new EmbeddedServer(appPort, appPath);
        server.start();
    }
View Full Code Here

        if (this.disabled) {
            return;
        }
        URI uri = new URI("tcp", null, bind, this.port, null, null, null);

        broker = new BrokerService();
        broker.setPersistent(false);
        broker.addConnector(uri);
    }
View Full Code Here

                if (brokerUri != null) {
                    brokerService = BrokerFactory.createBroker(new URI(brokerUri));
                    brokerName = brokerService.getBrokerName();
                }
                else {
                    brokerService = new BrokerService();
                    if (brokerName != null) {
                        brokerService.setBrokerName(brokerName);
                    }
                    else {
                        brokerName = brokerService.getBrokerName();
View Full Code Here

        }
    }

    public synchronized void doStop() throws Exception {
        if (brokerService != null) {
            BrokerService temp = brokerService;
            brokerService = null;
            try {
                temp.stop();
            } catch (JMSException ignored) {
                // just a lame exception ActiveMQ likes to throw on shutdown
                if (!(ignored.getCause() instanceof TransportDisposedIOException)) {
                    throw ignored;
                }
View Full Code Here

        }
    }

    public synchronized void doFail() {
        if (brokerService != null) {
            BrokerService temp = brokerService;
            brokerService = null;
            try {
                temp.stop();
            } catch (JMSException ignored) {
                // just a lame exception ActiveMQ likes to throw on shutdown
                if (!(ignored.getCause() instanceof TransportDisposedIOException)) {
                    log.warn("Caught while closing due to failure: " + ignored, ignored);
                }
View Full Code Here

    dataDir = new File(baseDir, "data");
    Assert.assertTrue(tmpDir.mkdir());
    passwordFile = new File(baseDir, "password");
    Files.write(PASSWORD.getBytes(Charsets.UTF_8), passwordFile);

    broker = new BrokerService();

    broker.addConnector(BROKER_BIND_URL);
    broker.setTmpDataDirectory(tmpDir);
    broker.setDataDirectoryFile(dataDir);
    List<AuthenticationUser> users = Lists.newArrayList();
View Full Code Here

     * @throws Exception
     */
    @Override
    protected void doPreSetup() throws Exception {
        deleteDirectory("target/activemq-data");
        broker = new BrokerService();
        int port = AvailablePortFinder.getNextAvailable(33333);
        brokerUri = "tcp://localhost:" + port;
        broker.getManagementContext().setConnectorPort(AvailablePortFinder.getNextAvailable(port + 1));
        configureBroker(broker);
        startBroker();
View Full Code Here

  public void disconnect() {
  }
  public void connect() throws Exception {
    try {
      amqBroker = new BrokerService();
      amqBroker.setUseJmx(false);
      amqBroker.addConnector("vm://localhost");
      amqBroker.addConnector("stomp://" + hostName + ":" + portNumber);
      amqBroker.start();
    } catch(Exception e) {
View Full Code Here

  public void disconnect() {
  }
  public void connect() throws Exception {
    try {
      amqBroker = new BrokerService();
      amqBroker.setUseJmx(false);
      amqBroker.addConnector("vm://localhost");
      amqBroker.addConnector("stomp://" + hostName + ":" + portNumber);
      amqBroker.start();
    } catch(Exception e) {
View Full Code Here

TOP

Related Classes of org.apache.activemq.broker.BrokerService

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.