Package org.apache.activemq.broker

Examples of org.apache.activemq.broker.Broker


        LOG.info("MemoryUseage at test end = " + endPercentage);
    }

    public void destroyQueue() {
        try {
            Broker broker = this.broker.getBroker();
            if (!broker.isStopped()) {
                LOG.info("Removing: " + queueName);
                broker.removeDestination(this.broker.getAdminConnectionContext(), new ActiveMQQueue(queueName), 10);
            }
        } catch (Exception e) {
            LOG.warn("Got an error while removing the test queue", e);
        }
    }
View Full Code Here


        assertEquals(startPercentage, endPercentage);
    }

    public void destroyQueue() {
        try {
            Broker broker = this.broker.getBroker();
            if (!broker.isStopped()) {
                LOG.info("Removing: " + queueName);
                broker.removeDestination(this.broker.getAdminConnectionContext(), new ActiveMQQueue(queueName), 10);
            }
        } catch (Exception e) {
            LOG.warn("Got an error while removing the test queue", e);
        }
    }
View Full Code Here

     * @param message message to send
     * @param destination possibly wildcard destination to send the message to
     * @throws Exception on error
     */
    protected void send(ProducerBrokerExchange context, Message message, ActiveMQDestination destination) throws Exception {
        Broker broker = context.getConnectionContext().getBroker();
        Set<Destination> destinations = broker.getDestinations(destination);

        for (Destination dest : destinations) {
            dest.send(context, message.copy());
        }
    }
View Full Code Here

     * Respect the selectors of the subscriptions to ensure only matched messages are dispatched to
     * the virtual queues, hence there is no build up of unmatched messages on these destinations
     */
    @Override
    protected void send(ProducerBrokerExchange context, Message message, ActiveMQDestination destination) throws Exception {
        Broker broker = context.getConnectionContext().getBroker();
        Set<Destination> destinations = broker.getDestinations(destination);

        for (Destination dest : destinations) {
            if (matchesSomeConsumer(broker, message, dest)) {
                dest.send(context, message.copy());
            }
View Full Code Here

        assertEquals(startPercentage, endPercentage);
    }

    public void destroyQueue() {
        try {
            Broker broker = this.broker.getBroker();
            if (!broker.isStopped()) {
                LOG.info("Removing: " + queueName);
                broker.removeDestination(this.broker.getAdminConnectionContext(), new ActiveMQQueue(queueName), 10);
            }
        } catch (Exception e) {
            LOG.warn("Got an error while removing the test queue", e);
        }
    }
View Full Code Here

        LOG.info("MemoryUseage at test end = " + endPercentage);
    }

    public void destroyQueue() {
        try {
            Broker broker = this.broker.getBroker();
            if (!broker.isStopped()) {
                LOG.info("Removing: " + queueName);
                broker.removeDestination(this.broker.getAdminConnectionContext(), new ActiveMQQueue(queueName), 10);
            }
        } catch (Exception e) {
            LOG.warn("Got an error while removing the test queue", e);
        }
    }
View Full Code Here

                }
            });
        }

        try {
            Broker broker = multiKahaDBPersistenceAdapter.getBrokerService().getBroker();
            // force completion of local xa
            for (TransactionId txid : broker.getPreparedTransactions(null)) {
                if (multiKahaDBPersistenceAdapter.isLocalXid(txid)) {
                    try {
                        if (recoveredPendingCommit.contains(txid)) {
                            LOG.info("delivering pending commit outcome for tid: " + txid);
                            broker.commitTransaction(null, txid, false);

                        } else {
                            LOG.info("delivering rollback outcome to store for tid: " + txid);
                            broker.forgetTransaction(null, txid);
                        }
                        persistCompletion(txid);
                    } catch (Exception ex) {
                        LOG.error("failed to deliver pending outcome for tid: " + txid, ex);
                    }
View Full Code Here

     * @param message message to send
     * @param destination possibly wildcard destination to send the message to
     * @throws Exception on error
     */
    protected void send(ProducerBrokerExchange context, Message message, ActiveMQDestination destination) throws Exception {
        Broker broker = context.getConnectionContext().getBroker();
        Set<Destination> destinations = broker.getDestinations(destination);

        for (Destination dest : destinations) {
            dest.send(context, message.copy());
        }
    }
View Full Code Here

                + httpConnector.getUri().toString()
                + " is stopped");
          }
          service.getManagementContext().stop();
          service.stop();
          Broker broker = service.getBroker();
          while (!broker.isStopped()) {
            synchronized (monitor) {
              try {
                monitor.wait(20); // wait for the broker to
                          // terminate
              } catch (Exception e) {
View Full Code Here

        redeliveryPolicyMap.setDefaultEntry(defaultEntry);
        underTest.setRedeliveryPolicyMap(redeliveryPolicyMap);

        final BrokerService brokerService = new BrokerService();
        brokerService.setSchedulerSupport(false);
        Broker broker = new ErrorBroker("hi") {
            @Override
            public BrokerService getBrokerService() {
                return brokerService;
            }
        };
View Full Code Here

TOP

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

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.