use of org.apache.rocketmq.store.config.MessageStoreConfig in project rocketmq-externals by apache.
the class RocketMQSourceTest method startBroker.
private static void startBroker() throws Exception {
System.setProperty(RemotingCommand.REMOTING_VERSION_KEY, Integer.toString(MQVersion.CURRENT_VERSION));
BrokerConfig brokerConfig = new BrokerConfig();
brokerConfig.setNamesrvAddr(nameServer);
brokerConfig.setBrokerId(MixAll.MASTER_ID);
NettyServerConfig nettyServerConfig = new NettyServerConfig();
nettyServerConfig.setListenPort(10911);
NettyClientConfig nettyClientConfig = new NettyClientConfig();
MessageStoreConfig messageStoreConfig = new MessageStoreConfig();
brokerController = new BrokerController(brokerConfig, nettyServerConfig, nettyClientConfig, messageStoreConfig);
boolean initResult = brokerController.initialize();
if (!initResult) {
brokerController.shutdown();
throw new Exception();
}
brokerController.start();
}
use of org.apache.rocketmq.store.config.MessageStoreConfig in project rocketmq-externals by apache.
the class RocketMQSinkTest method startBroker.
private static void startBroker() throws Exception {
System.setProperty(RemotingCommand.REMOTING_VERSION_KEY, Integer.toString(MQVersion.CURRENT_VERSION));
BrokerConfig brokerConfig = new BrokerConfig();
brokerConfig.setNamesrvAddr(nameServer);
brokerConfig.setBrokerId(MixAll.MASTER_ID);
NettyServerConfig nettyServerConfig = new NettyServerConfig();
nettyServerConfig.setListenPort(10911);
NettyClientConfig nettyClientConfig = new NettyClientConfig();
MessageStoreConfig messageStoreConfig = new MessageStoreConfig();
brokerController = new BrokerController(brokerConfig, nettyServerConfig, nettyClientConfig, messageStoreConfig);
boolean initResult = brokerController.initialize();
if (!initResult) {
brokerController.shutdown();
throw new Exception();
}
brokerController.start();
}
use of org.apache.rocketmq.store.config.MessageStoreConfig in project rocketmq-externals by apache.
the class ReplicatorTest method startBroker.
/**
* This method starts the RocketMQ broker.
*
* @throws Exception
*/
private static void startBroker() throws Exception {
System.setProperty(RemotingCommand.REMOTING_VERSION_KEY, Integer.toString(MQVersion.CURRENT_VERSION));
final BrokerConfig brokerConfig = new BrokerConfig();
brokerConfig.setNamesrvAddr(NAMESERVER);
brokerConfig.setBrokerId(MixAll.MASTER_ID);
final NettyServerConfig nettyServerConfig = new NettyServerConfig();
nettyServerConfig.setListenPort(10911);
final NettyClientConfig nettyClientConfig = new NettyClientConfig();
final MessageStoreConfig messageStoreConfig = new MessageStoreConfig();
brokerController = new BrokerController(brokerConfig, nettyServerConfig, nettyClientConfig, messageStoreConfig);
boolean initResult = brokerController.initialize();
if (!initResult) {
brokerController.shutdown();
throw new Exception();
}
brokerController.start();
}
use of org.apache.rocketmq.store.config.MessageStoreConfig in project rocketmq-externals by apache.
the class RocketMQSourceTest method startBroker.
/**
* This method starts the RocketMQ broker.
*
* @throws Exception
*/
private static void startBroker() throws Exception {
System.setProperty(RemotingCommand.REMOTING_VERSION_KEY, Integer.toString(MQVersion.CURRENT_VERSION));
BrokerConfig brokerConfig = new BrokerConfig();
brokerConfig.setNamesrvAddr(NAMESERVER);
brokerConfig.setBrokerId(MixAll.MASTER_ID);
NettyServerConfig nettyServerConfig = new NettyServerConfig();
nettyServerConfig.setListenPort(10911);
NettyClientConfig nettyClientConfig = new NettyClientConfig();
MessageStoreConfig messageStoreConfig = new MessageStoreConfig();
brokerController = new BrokerController(brokerConfig, nettyServerConfig, nettyClientConfig, messageStoreConfig);
boolean initResult = brokerController.initialize();
if (!initResult) {
brokerController.shutdown();
throw new Exception();
}
brokerController.start();
}
use of org.apache.rocketmq.store.config.MessageStoreConfig in project rocketmq-externals by apache.
the class IntegrationTestBase method createAndStartBroker.
public static BrokerController createAndStartBroker(String nsAddr) {
String baseDir = createBaseDir();
BrokerConfig brokerConfig = new BrokerConfig();
NettyServerConfig nettyServerConfig = new NettyServerConfig();
NettyClientConfig nettyClientConfig = new NettyClientConfig();
MessageStoreConfig storeConfig = new MessageStoreConfig();
brokerConfig.setBrokerName(BROKER_NAME_PREFIX + BROKER_INDEX.getAndIncrement());
brokerConfig.setBrokerIP1("127.0.0.1");
brokerConfig.setNamesrvAddr(nsAddr);
storeConfig.setStorePathRootDir(baseDir);
storeConfig.setStorePathCommitLog(baseDir + SEP + "commitlog");
storeConfig.setHaListenPort(8000 + random.nextInt(1000));
nettyServerConfig.setListenPort(10000 + random.nextInt(1000));
BrokerController brokerController = new BrokerController(brokerConfig, nettyServerConfig, nettyClientConfig, storeConfig);
try {
Assert.assertTrue(brokerController.initialize());
logger.info("Broker Start name:{} addr:{}", brokerConfig.getBrokerName(), brokerController.getBrokerAddr());
brokerController.start();
} catch (Exception e) {
System.out.println("Broker start failed");
System.exit(1);
}
BROKER_CONTROLLERS.add(brokerController);
return brokerController;
}
Aggregations