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


Java ServerUtil类代码示例

本文整理汇总了Java中com.alibaba.rocketmq.srvutil.ServerUtil的典型用法代码示例。如果您正苦于以下问题:Java ServerUtil类的具体用法?Java ServerUtil怎么用?Java ServerUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: execute

import com.alibaba.rocketmq.srvutil.ServerUtil; //导入依赖的package包/类
@Override
public void execute(CommandLine commandLine, Options options, RPCHook rpcHook) {
    DefaultMQAdminExt adminExt = new DefaultMQAdminExt(rpcHook);
    adminExt.setInstanceName(Long.toString(System.currentTimeMillis()));
    try {
        String topic = commandLine.getOptionValue('t').trim();

        if (commandLine.hasOption('c')) {
            String clusterName = commandLine.getOptionValue('c').trim();

            adminExt.start();
            deleteTopic(adminExt, clusterName, topic);
            return;
        }

        ServerUtil.printCommandLineHelp("mqadmin " + this.commandName(), options);
    }
    catch (Exception e) {
        e.printStackTrace();
    }
    finally {
        adminExt.shutdown();
    }
}
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:25,代码来源:DeleteTopicSubCommand.java

示例2: main

import com.alibaba.rocketmq.srvutil.ServerUtil; //导入依赖的package包/类
public static void main(String[] args) {
    System.setProperty(MixAll.NAMESRV_ADDR_PROPERTY, "127.0.0.1:9876");
    CloneGroupOffsetCommand cmd = new CloneGroupOffsetCommand();
    Options options = ServerUtil.buildCommandlineOptions(new Options());
    String[] subargs =
            new String[] { "-t qatest_TopicTest", "-g qatest_consumer", "-s 1389098416742", "-f true" };
    final CommandLine commandLine =
            ServerUtil.parseCmdLine("mqadmin " + cmd.commandName(), subargs,
                cmd.buildCommandlineOptions(options), new PosixParser());
    cmd.execute(commandLine, options, null);
}
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:12,代码来源:CloneGroupOffsetCommand.java

示例3: main

import com.alibaba.rocketmq.srvutil.ServerUtil; //导入依赖的package包/类
public static void main(String[] args) {
    System.setProperty(MixAll.NAMESRV_ADDR_PROPERTY, "127.0.0.1:9876");
    GetConsumerStatusCommand cmd = new GetConsumerStatusCommand();
    Options options = ServerUtil.buildCommandlineOptions(new Options());
    String[] subargs = new String[] { "-t qatest_TopicTest", "-g qatest_consumer_broadcast" };
    final CommandLine commandLine =
            ServerUtil.parseCmdLine("mqadmin " + cmd.commandName(), subargs,
                cmd.buildCommandlineOptions(options), new PosixParser());
    cmd.execute(commandLine, options, null);
}
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:11,代码来源:GetConsumerStatusCommand.java

示例4: main

import com.alibaba.rocketmq.srvutil.ServerUtil; //导入依赖的package包/类
public static void main(String[] args) {
    System.setProperty(MixAll.NAMESRV_ADDR_PROPERTY, "127.0.0.1:9876");
    ResetOffsetByTimeCommand cmd = new ResetOffsetByTimeCommand();
    Options options = ServerUtil.buildCommandlineOptions(new Options());
    String[] subargs =
            new String[] { "-t qatest_TopicTest", "-g qatest_consumer", "-s 1389098416742", "-f true" };
    final CommandLine commandLine =
            ServerUtil.parseCmdLine("mqadmin " + cmd.commandName(), subargs,
                cmd.buildCommandlineOptions(options), new PosixParser());
    cmd.execute(commandLine, options, null);
}
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:12,代码来源:ResetOffsetByTimeCommand.java


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