Package com.trendmicro.tme.broker

Examples of com.trendmicro.tme.broker.BrokerAdmin


            node.create(false, dropConfig.toString().getBytes());
        }
       
        String broker = exchangeFarm.getCurrentExchangeHost(ex);
        if(broker != null) {
            BrokerAdmin brokerAdmin = new BrokerAdmin(broker);
            brokerAdmin.jmxConnectServer();
            try {
               
                if(dropConfig.getPolicy().equals(ZooKeeperInfo.DropConfig.Policy.NEWEST)) {
                    brokerAdmin.setExchangeAttrib(ex, "LimitBehavior", "REJECT_NEWEST");
                }
                else {
                    brokerAdmin.setExchangeAttrib(ex, "LimitBehavior", "REMOVE_OLDEST");
                }
            }
            finally {
                brokerAdmin.jmxCloseServer();
            }
        }
    }
View Full Code Here


        String path = "/global/drop_exchange/" + ex.getName();
       
        new ZNode(path).delete();
        String broker = exchangeFarm.getCurrentExchangeHost(ex);
        if(broker != null) {
            BrokerAdmin brokerAdmin = new BrokerAdmin(broker);
            brokerAdmin.jmxConnectServer();
            try {
                brokerAdmin.setExchangeAttrib(ex, "LimitBehavior", "FLOW_CONTROL");
            }
            finally {
                brokerAdmin.jmxCloseServer();
            }
        }
    }
View Full Code Here

            node.create(false, limit.toBuilder().setSizeBytes(Long.valueOf(sizeLimit)).build().toString().getBytes());
        }
       
        String broker = exchangeFarm.getCurrentExchangeHost(ex);
        if(broker != null) {
            BrokerAdmin brokerAdmin = new BrokerAdmin(broker);
            brokerAdmin.jmxConnectServer();
            try {
                brokerAdmin.setExchangeAttrib(ex, "MaxTotalMsgBytes", Long.valueOf(sizeLimit));
            }
            finally {
                brokerAdmin.jmxCloseServer();
            }
        }
    }
View Full Code Here

            node.create(false, limit.toBuilder().setCount(Long.valueOf(countLimit)).build().toString().getBytes());
        }
       
        String broker = exchangeFarm.getCurrentExchangeHost(ex);
        if(broker != null) {
            BrokerAdmin brokerAdmin = new BrokerAdmin(broker);
            brokerAdmin.jmxConnectServer();
            try {
                brokerAdmin.setExchangeAttrib(ex, "MaxNumMsgs", Long.valueOf(countLimit));
            }
            finally {
                brokerAdmin.jmxCloseServer();
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.trendmicro.tme.broker.BrokerAdmin

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.