private void onGRPCAlarmSettingUpdated(Map<String, GRPCAlarmSetting> newAlarmSettingMap) {
        if (newAlarmSettingMap == null || newAlarmSettingMap.isEmpty()) {
            if (grpcClientMap != null) {
                grpcClientMap.forEach((name, grpcClient) -> {
                    grpcClient.shutdown();
                    log.debug("gRPC alarm hook target is empty, shutdown the old gRPC client.");
                });
            }
            alarmServiceStubMap = null;
            alarmSettingMap = null;

            return;
        }

        newAlarmSettingMap.forEach((name, newAlarmSetting) -> {
            if (!newAlarmSetting.equals(alarmSettingMap.get(name))) {
                GRPCClient grpcClient = grpcClientMap.get(name);
                if (grpcClient != null) {
                    grpcClient.shutdown();
                    grpcClientMap.remove(name);
                    alarmServiceStubMap.remove(name);
                    log.debug("gRPC alarm hook target is changed, shutdown the old gRPC client.");
                }
                if (newAlarmSetting.isEmptySetting()) {
                    return;
                }
                grpcClient = new GRPCClient(newAlarmSetting.getTargetHost(), newAlarmSetting.getTargetPort());
                grpcClient.connect();
                grpcClientMap.put(name, grpcClient);
                alarmServiceStubMap.put(name, AlarmServiceGrpc.newStub(grpcClient.getChannel()));
            }
        });
    }
Use SkyWalking alarm grpc API call a remote methods.
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc/GRPCCallback.java