Search in sources :

Example 1 with MonitorService

use of org.apache.rocketmq.tools.monitor.MonitorService in project rocketmq by apache.

the class StartMonitoringSubCommand method execute.

@Override
public void execute(CommandLine commandLine, Options options, RPCHook rpcHook) throws SubCommandException {
    try {
        MonitorService monitorService = new MonitorService(new MonitorConfig(), new DefaultMonitorListener(), rpcHook);
        monitorService.start();
    } catch (Exception e) {
        throw new SubCommandException(this.getClass().getSimpleName() + " command failed", e);
    }
}
Also used : SubCommandException(org.apache.rocketmq.tools.command.SubCommandException) MonitorService(org.apache.rocketmq.tools.monitor.MonitorService) DefaultMonitorListener(org.apache.rocketmq.tools.monitor.DefaultMonitorListener) SubCommandException(org.apache.rocketmq.tools.command.SubCommandException) MonitorConfig(org.apache.rocketmq.tools.monitor.MonitorConfig)

Example 2 with MonitorService

use of org.apache.rocketmq.tools.monitor.MonitorService in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.

the class StartMonitoringSubCommand method execute.

@Override
public void execute(CommandLine commandLine, Options options, RPCHook rpcHook) throws SubCommandException {
    try {
        MonitorService monitorService = new MonitorService(new MonitorConfig(), new DefaultMonitorListener(), rpcHook);
        monitorService.start();
    } catch (Exception e) {
        throw new SubCommandException(this.getClass().getSimpleName() + " command failed", e);
    }
}
Also used : SubCommandException(org.apache.rocketmq.tools.command.SubCommandException) MonitorService(org.apache.rocketmq.tools.monitor.MonitorService) DefaultMonitorListener(org.apache.rocketmq.tools.monitor.DefaultMonitorListener) SubCommandException(org.apache.rocketmq.tools.command.SubCommandException) MonitorConfig(org.apache.rocketmq.tools.monitor.MonitorConfig)

Aggregations

SubCommandException (org.apache.rocketmq.tools.command.SubCommandException)2 DefaultMonitorListener (org.apache.rocketmq.tools.monitor.DefaultMonitorListener)2 MonitorConfig (org.apache.rocketmq.tools.monitor.MonitorConfig)2 MonitorService (org.apache.rocketmq.tools.monitor.MonitorService)2