getTelemetry()
This operation returns the telemetry manager for the connected client.
java
public ClientTelemetryManager getTelemetry()
RETURN TYPE:
ClientTelemetryManager
RETURNS:
The telemetry manager for the connected client, or null when telemetry is not available.
PARAMETERS:
-
telemetry (ClientTelemetryManager) -
The ClientTelemetryManager instance for the connected client. Check telemetry support with
isSupported(), register a server-pushed command handler withregisterCommandHandler(), and read the active configuration withgetConfig().
EXCEPTIONS:
-
MilvusClientException
This exception will be raised when any error occurs during this operation.
Example
java
MilvusClientV2 client = new MilvusClientV2(ConnectConfig.builder()
.uri("YOUR_CLUSTER_ENDPOINT")
.token("YOUR_CLUSTER_TOKEN")
.build());
ClientTelemetryManager telemetry = client.getTelemetry();
if (telemetry != null && telemetry.isSupported()) {
telemetry.registerCommandHandler("custom_command", command -> {
// Handle a server-pushed telemetry command.
return TelemetryCommandReply.of(command);
});
}