Examples of BrokerView


Examples of org.apache.activemq.broker.jmx.BrokerView

        for (int i = 0; i < numMessages; i++) {
            sendMessage(false);
        }

        final BrokerView brokerView = broker.getAdminView();

        broker.getSystemUsage().getStoreUsage().isFull();
        LOG.info("store percent usage: " + brokerView.getStorePercentUsage());
        assertTrue("redelivery consumer got all it needs, remaining: "
                + redeliveryConsumerLatch.getCount(), redeliveryConsumerLatch.await(60, TimeUnit.SECONDS));
        assertTrue("dql  consumer got all it needs", dlqConsumerLatch.await(60, TimeUnit.SECONDS));
        closeConsumer();
View Full Code Here

Examples of org.apache.activemq.broker.jmx.BrokerView

        slaveStartSignal.countDown();
    }
   
    protected void startManagementContext() throws Exception {
        getManagementContext().start();
        adminView = new BrokerView(this, null);
        ObjectName objectName = getBrokerObjectName();
        AnnotatedMBean.registerMBean(getManagementContext(), adminView, objectName);
    }
View Full Code Here

Examples of org.apache.activemq.broker.jmx.BrokerView

        // TODO could use JMX to look this up
        return brokerService.getAdminView();
    }

    public ManagedRegionBroker getManagedBroker() throws Exception {
        BrokerView adminView = brokerService.getAdminView();
        if (adminView == null) {
            return null;
        }
        return adminView.getBroker();
    }
View Full Code Here

Examples of org.apache.activemq.broker.jmx.BrokerView

//        RegionBroker rBroker = (RegionBroker)regionBroker;

        if (isUseJmx()) {
            ManagedRegionBroker managedBroker = (ManagedRegionBroker)regionBroker;
            managedBroker.setContextBroker(broker);
            adminView = new BrokerView(this, managedBroker);
            MBeanServer mbeanServer = getManagementContext().getMBeanServer();
            if (mbeanServer != null) {
                ObjectName objectName = getBrokerObjectName();
                mbeanServer.registerMBean(adminView, objectName);
                registeredMBeanNames.add(objectName);
View Full Code Here

Examples of org.apache.activemq.broker.jmx.BrokerView

        slaveStartSignal.countDown();
    }

    protected void startManagementContext() throws Exception {
        getManagementContext().start();
        adminView = new BrokerView(this, null);
        ObjectName objectName = getBrokerObjectName();
        AnnotatedMBean.registerMBean(getManagementContext(), adminView, objectName);
    }
View Full Code Here

Examples of org.apache.activemq.broker.jmx.BrokerView

        for (int i = 0; i < 5000; i++) {
            sendMessage(false);
        }

        final BrokerView brokerView = broker.getAdminView();

        broker.getSystemUsage().getStoreUsage().isFull();
        LOG.info("store percent usage: "+brokerView.getStorePercentUsage());
        assertTrue("some store in use", broker.getAdminView().getStorePercentUsage() > minPercentUsageForStore);

        assertTrue("redelivery consumer got all it needs", redeliveryConsumerLatch.await(60, TimeUnit.SECONDS));
        closeConsumer();

        // consume from DLQ
        final CountDownLatch received = new CountDownLatch(5000 -1);
        consumerConnection = (ActiveMQConnection) createConnection();
        Session dlqSession = consumerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        MessageConsumer dlqConsumer = dlqSession.createConsumer(new ActiveMQQueue("ActiveMQ.DLQ"));
        dlqConsumer.setMessageListener(new MessageListener() {
            public void onMessage(Message message) {
                if (received.getCount() % 500 == 0) {
                    LOG.info("remaining on DLQ: " + received.getCount());
                }
                received.countDown();
            }
        });
        consumerConnection.start();

        assertTrue("Not all messages reached the DLQ", received.await(60, TimeUnit.SECONDS));

        assertTrue("Store usage exceeds expected usage",
                Wait.waitFor(new Wait.Condition() {
                    public boolean isSatisified() throws Exception {
                        broker.getSystemUsage().getStoreUsage().isFull();
                        LOG.info("store precent usage: "+brokerView.getStorePercentUsage());
                        return broker.getAdminView().getStorePercentUsage() < minPercentUsageForStore;
                    }
                }));

         closeConsumer();
View Full Code Here

Examples of org.apache.activemq.broker.jmx.BrokerView

        for (int i = 0; i < 5000; i++) {
            sendMessage(false);
        }

        final BrokerView brokerView = broker.getAdminView();

        // wait for reclaim
        assertTrue("in range with consumer",
                Wait.waitFor(new Wait.Condition() {
                    public boolean isSatisified() throws Exception {
                        // usage percent updated only on send check for isFull so once
                        // sends complete it is no longer updated till next send via a call to isFull
                        // this is optimal as it is only used to block producers
                        broker.getSystemUsage().getStoreUsage().isFull();
                        LOG.info("store precent usage: "+brokerView.getStorePercentUsage());
                        return broker.getAdminView().getStorePercentUsage() < minPercentUsageForStore;
                    }
                }));


        closeConsumer();

        assertTrue("in range with closed consumer",
                Wait.waitFor(new Wait.Condition() {
                    public boolean isSatisified() throws Exception {
                        broker.getSystemUsage().getStoreUsage().isFull();
                        LOG.info("store precent usage: "+brokerView.getStorePercentUsage());
                        return broker.getAdminView().getStorePercentUsage() < minPercentUsageForStore;
                    }
                }));

        for (int i = 0; i < 5000; i++) {
            sendMessage(false);
        }

        // What if i drop the subscription?
        broker.getAdminView().destroyDurableSubscriber("cliID", "subName");

        assertTrue("in range after send with consumer",
                Wait.waitFor(new Wait.Condition() {
                    public boolean isSatisified() throws Exception {
                        broker.getSystemUsage().getStoreUsage().isFull();
                        LOG.info("store precent usage: "+brokerView.getStorePercentUsage());                       
                        return broker.getAdminView().getStorePercentUsage() < minPercentUsageForStore;
                    }
                }));

    }
View Full Code Here

Examples of org.apache.activemq.broker.jmx.BrokerView

        for (int i = 0; i < 5000; i++) {
            sendMessage(false);
        }

        final BrokerView brokerView = broker.getAdminView();

        broker.getSystemUsage().getStoreUsage().isFull();
        LOG.info("store percent usage: "+brokerView.getStorePercentUsage());
        assertTrue("some store in use", broker.getAdminView().getStorePercentUsage() > minPercentUsageForStore);

        assertTrue("redelivery consumer got all it needs", redeliveryConsumerLatch.await(60, TimeUnit.SECONDS));
        closeConsumer();

        // consume from DLQ
        final CountDownLatch received = new CountDownLatch(5000 -1);
        consumerConnection = (ActiveMQConnection) createConnection();
        Session dlqSession = consumerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        MessageConsumer dlqConsumer = dlqSession.createConsumer(new ActiveMQQueue("ActiveMQ.DLQ"));
        dlqConsumer.setMessageListener(new MessageListener() {
            public void onMessage(Message message) {
                if (received.getCount() % 500 == 0) {
                    LOG.info("remaining on DLQ: " + received.getCount());
                }
                received.countDown();
            }
        });
        consumerConnection.start();

        assertTrue("Not all messages reached the DLQ", received.await(60, TimeUnit.SECONDS));

        assertTrue("Store usage exceeds expected usage",
                Wait.waitFor(new Wait.Condition() {
                    public boolean isSatisified() throws Exception {
                        broker.getSystemUsage().getStoreUsage().isFull();
                        LOG.info("store precent usage: "+brokerView.getStorePercentUsage());
                        return broker.getAdminView().getStorePercentUsage() < minPercentUsageForStore;
                    }
                }));

         closeConsumer();
View Full Code Here

Examples of org.apache.activemq.broker.jmx.BrokerView

        slaveStartSignal.countDown();
    }
   
    protected void startManagementContext() throws Exception {
        getManagementContext().start();
        adminView = new BrokerView(this, null);
        ObjectName objectName = getBrokerObjectName();
        AnnotatedMBean.registerMBean(getManagementContext(), adminView, objectName);
    }
View Full Code Here

Examples of org.apache.activemq.broker.jmx.BrokerView

        assertEquals("received expected amount", 500, receiveExactMessages("BrokerB", 500));
        validateQueueStats();
    }
   
    private void validateQueueStats() throws Exception {
       final BrokerView brokerView = brokers.get("BrokerA").broker.getAdminView();
       assertEquals("enequeue is correct", 1000, brokerView.getTotalEnqueueCount());
      
       assertTrue("dequeue is correct", Wait.waitFor(new Wait.Condition() {
           public boolean isSatisified() throws Exception {
               LOG.info("dequeue count (want 1000), is : " + brokerView.getTotalDequeueCount());
               return 1000 == brokerView.getTotalDequeueCount();
           }
       }));
    }
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.