Package com.taobao.metamorphosis.utils.ZkUtils

Examples of com.taobao.metamorphosis.utils.ZkUtils.ZKConfig


import com.taobao.metamorphosis.utils.ZkUtils.ZKConfig;

public class MessageSenderTest {
  public static void main(String[] args) throws Exception {
    MetaClientConfig config = new MetaClientConfig();
    ZKConfig zkConfig = new ZKConfig("10.249.197.121", 30000, 30000, 5000);
    config.setZkConfig(zkConfig);
    MetaMessageSessionFactory factory = new MetaMessageSessionFactory(config);
    MessageProducer producer = factory.createProducer(false);
    String topic = "test";
    producer.publish(topic);
View Full Code Here


        if (!StringUtil.empty(zkConnect)) {
            final int zkSessionTimeoutMs = Integer.parseInt(serverProperties.getProperty("zk.zkSessionTimeoutMs"));
            final int zkConnectionTimeoutMs =
                    Integer.parseInt(serverProperties.getProperty("zk.zkConnectionTimeoutMs"));
            final int zkSyncTimeMs = Integer.parseInt(serverProperties.getProperty("zk.zkSyncTimeMs"));
            return this.setZkRoot(new ZKConfig(zkConnect, zkSessionTimeoutMs, zkConnectionTimeoutMs, zkSyncTimeMs),
                zkRoot);
        }
        else {
            return null;
        }
View Full Code Here

     */
    // ��Ԫ����Ҫ��ͨ����,���޸�resources/zk.properties���zk��ַ
    private ZKConfig loadZkConfigFromLocalFile() {
        try {
            final Properties properties = Utils.getResourceAsProperties("zk.properties", "GBK");
            final ZKConfig zkConfig = new ZKConfig();
            if (StringUtils.isNotBlank(properties.getProperty("zk.zkConnect"))) {
                zkConfig.zkConnect = properties.getProperty("zk.zkConnect");
            }

            if (StringUtils.isNotBlank(properties.getProperty("zk.zkSessionTimeoutMs"))) {
View Full Code Here

TOP

Related Classes of com.taobao.metamorphosis.utils.ZkUtils.ZKConfig

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.