Problem
GrpcClientSettingsManager.mergeMetric(...) parses the configured metric collector address with a raw split:
String[] split = metricCollectorAddress.split(":");
String host = split[0];
int port = Integer.parseInt(split[1]);
When metricCollectorMode=on but metricCollectorAddress is blank or malformed, the settings merge path can throw ArrayIndexOutOfBoundsException or NumberFormatException. That can break gRPC client settings generation instead of returning a controlled metric setting.
Expected behavior
Proxy should not fail client settings merge because of an invalid optional metric collector address. It should validate the address, log a clear warning, and disable metric collection for that settings response when the address cannot be parsed.
Scope
Track 2 / Proxy gRPC client diagnostics and robustness. This only hardens metric endpoint parsing in gRPC client settings and should not change valid host:port handling.
Evidence
proxy/src/main/java/org/apache/rocketmq/proxy/grpc/v2/common/GrpcClientSettingsManager.java
mergeMetric(...) reads metricCollectorAddress.split(":") and indexes split[1] without validation.
Problem
GrpcClientSettingsManager.mergeMetric(...)parses the configured metric collector address with a raw split:When
metricCollectorMode=onbutmetricCollectorAddressis blank or malformed, the settings merge path can throwArrayIndexOutOfBoundsExceptionorNumberFormatException. That can break gRPC client settings generation instead of returning a controlled metric setting.Expected behavior
Proxy should not fail client settings merge because of an invalid optional metric collector address. It should validate the address, log a clear warning, and disable metric collection for that settings response when the address cannot be parsed.
Scope
Track 2 / Proxy gRPC client diagnostics and robustness. This only hardens metric endpoint parsing in gRPC client settings and should not change valid
host:porthandling.Evidence
proxy/src/main/java/org/apache/rocketmq/proxy/grpc/v2/common/GrpcClientSettingsManager.javamergeMetric(...)readsmetricCollectorAddress.split(":")and indexessplit[1]without validation.