use of org.apache.eventmesh.runtime.core.protocol.tcp.client.session.retry.EventMeshTcpRetryer in project incubator-eventmesh by apache.
the class EventMeshTCPServer method init.
public void init() throws Exception {
logger.info("==================EventMeshTCPServer Initialing==================");
initThreadPool();
rateLimiter = RateLimiter.create(eventMeshTCPConfiguration.eventMeshTcpMsgReqnumPerSecond);
globalTrafficShapingHandler = newGTSHandler();
clientManageController = new ClientManageController(this);
clientSessionGroupMapping = new ClientSessionGroupMapping(this);
clientSessionGroupMapping.init();
eventMeshTcpRetryer = new EventMeshTcpRetryer(this);
eventMeshTcpRetryer.init();
// The MetricsRegistry is singleton, so we can use factory method to get.
final List<MetricsRegistry> metricsRegistries = Lists.newArrayList();
Optional.ofNullable(eventMeshTCPConfiguration.eventMeshMetricsPluginType).ifPresent(metricsPlugins -> metricsPlugins.forEach(pluginType -> metricsRegistries.add(MetricsPluginFactory.getMetricsRegistry(pluginType))));
eventMeshTcpMonitor = new EventMeshTcpMonitor(this, metricsRegistries);
eventMeshTcpMonitor.init();
if (eventMeshTCPConfiguration.eventMeshServerRegistryEnable) {
eventMeshRebalanceService = new EventMeshRebalanceService(this, new EventmeshRebalanceImpl(this));
eventMeshRebalanceService.init();
}
logger.info("--------------------------EventMeshTCPServer Inited");
}
Aggregations