当前位置: 首页>>代码示例>>Java>>正文


Java NamesrvUtil.NAMESPACE_PROJECT_CONFIG属性代码示例

本文整理汇总了Java中com.alibaba.rocketmq.common.namesrv.NamesrvUtil.NAMESPACE_PROJECT_CONFIG属性的典型用法代码示例。如果您正苦于以下问题:Java NamesrvUtil.NAMESPACE_PROJECT_CONFIG属性的具体用法?Java NamesrvUtil.NAMESPACE_PROJECT_CONFIG怎么用?Java NamesrvUtil.NAMESPACE_PROJECT_CONFIG使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.alibaba.rocketmq.common.namesrv.NamesrvUtil的用法示例。


在下文中一共展示了NamesrvUtil.NAMESPACE_PROJECT_CONFIG属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateProjectGroup

@CmdTrace(cmdClazz = UpdateProjectGroupCommand.class)
public boolean updateProjectGroup(String ip, String project) throws Throwable {
    Throwable t = null;
    DefaultMQAdminExt defaultMQAdminExt = getDefaultMQAdminExt();
    String namespace = NamesrvUtil.NAMESPACE_PROJECT_CONFIG;
    try {
        defaultMQAdminExt.start();
        defaultMQAdminExt.createAndUpdateKvConfig(namespace, ip, project);
        return true;
    }
    catch (Throwable e) {
        logger.error(e.getMessage(), e);
        t = e;
    }
    finally {
        shutdownDefaultMQAdminExt(defaultMQAdminExt);
    }
    throw t;
}
 
开发者ID:LXLun,项目名称:RocketMQMonitor,代码行数:19,代码来源:NamesrvService.java

示例2: execute

@Override
public void execute(CommandLine commandLine, Options options) {
    DefaultMQAdminExt defaultMQAdminExt = new DefaultMQAdminExt();
    defaultMQAdminExt.setInstanceName(Long.toString(System.currentTimeMillis()));
    try {
        String namespace = NamesrvUtil.NAMESPACE_PROJECT_CONFIG;
        String ip = commandLine.getOptionValue('i').trim();
        String project = commandLine.getOptionValue('p').trim();

        defaultMQAdminExt.start();
        defaultMQAdminExt.createAndUpdateKvConfig(namespace, ip, project);
        System.out.printf("create or update kv config to namespace success.\n");
        return;
    }
    catch (Exception e) {
        e.printStackTrace();
    }
    finally {
        defaultMQAdminExt.shutdown();
    }
}
 
开发者ID:diwayou,项目名称:rocketmq-all-trans,代码行数:21,代码来源:UpdateProjectGroupCommand.java

示例3: deleteProjectGroup

@CmdTrace(cmdClazz = DeleteProjectGroupCommand.class)
public boolean deleteProjectGroup(String ip, String project) throws Throwable {
    Throwable t = null;
    DefaultMQAdminExt defaultMQAdminExt = getDefaultMQAdminExt();
    String namespace = NamesrvUtil.NAMESPACE_PROJECT_CONFIG;
    try {
        if (StringUtils.isNotBlank(ip)) {
            defaultMQAdminExt.start();
            defaultMQAdminExt.deleteKvConfig(namespace, ip);
            return true;
        }
        else if (StringUtils.isNotBlank(project)) {
            defaultMQAdminExt.start();
            defaultMQAdminExt.deleteIpsByProjectGroup(project);
            return true;
        }
        else {
            throw new IllegalStateException("project or ip can not be all blank!");
        }
    }
    catch (Throwable e) {
        logger.error(e.getMessage(), e);
        t = e;
    }
    finally {
        shutdownDefaultMQAdminExt(defaultMQAdminExt);
    }
    throw t;
}
 
开发者ID:LXLun,项目名称:RocketMQMonitor,代码行数:29,代码来源:NamesrvService.java

示例4: execute

@Override
public void execute(CommandLine commandLine, Options options) {
    DefaultMQAdminExt defaultMQAdminExt = new DefaultMQAdminExt();
    defaultMQAdminExt.setInstanceName(Long.toString(System.currentTimeMillis()));
    try {
        String namespace = NamesrvUtil.NAMESPACE_PROJECT_CONFIG;

        if (commandLine.hasOption("i")) {
            String ip = commandLine.getOptionValue('i').trim();
            defaultMQAdminExt.start();
            defaultMQAdminExt.deleteKvConfig(namespace, ip);
            System.out.printf("delete project group from namespace by server ip success.\n");
        }
        else if (commandLine.hasOption("p")) {
            String project = commandLine.getOptionValue('p').trim();
            defaultMQAdminExt.start();
            defaultMQAdminExt.deleteIpsByProjectGroup(project);
            System.out.printf("delete all server ip from namespace by project group success.\n");
        }
        else {
            MixAll.printCommandLineHelp("mqadmin " + this.commandName(), options);
        }
    }
    catch (Exception e) {
        e.printStackTrace();
    }
    finally {
        defaultMQAdminExt.shutdown();
    }
}
 
开发者ID:diwayou,项目名称:rocketmq-all-trans,代码行数:30,代码来源:DeleteProjectGroupCommand.java

示例5: getIpsByProjectGroup

@Override
public String getIpsByProjectGroup(String projectGroup) throws RemotingException, MQBrokerException,
        InterruptedException, MQClientException {
    String namespace = NamesrvUtil.NAMESPACE_PROJECT_CONFIG;
    return this.mQClientFactory.getMQClientAPIImpl().getKVConfigByValue(namespace, projectGroup, 3000);
}
 
开发者ID:diwayou,项目名称:rocketmq-all-trans,代码行数:6,代码来源:DefaultMQAdminExtImpl.java

示例6: deleteIpsByProjectGroup

@Override
public void deleteIpsByProjectGroup(String projectGroup) throws RemotingException, MQBrokerException,
        InterruptedException, MQClientException {
    String namespace = NamesrvUtil.NAMESPACE_PROJECT_CONFIG;
    this.mQClientFactory.getMQClientAPIImpl().deleteKVConfigByValue(namespace, projectGroup, 3000);
}
 
开发者ID:diwayou,项目名称:rocketmq-all-trans,代码行数:6,代码来源:DefaultMQAdminExtImpl.java


注:本文中的com.alibaba.rocketmq.common.namesrv.NamesrvUtil.NAMESPACE_PROJECT_CONFIG属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。