package com.ard.zlm.api.factory; import com.ard.common.core.domain.R; import com.ard.common.core.domain.RtpServerParam; import com.ard.zlm.api.RemoteZlmService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.stereotype.Component; /** * zlm接口服务降级处理 * * @FileName RemoteZlmFallbackFactory * @Description * @Author fengcheng * @date 2026-03-28 **/ @Component public class RemoteZlmFallbackFactory implements FallbackFactory { private static final Logger log = LoggerFactory.getLogger(RemoteZlmFallbackFactory.class); @Override public RemoteZlmService create(Throwable throwable) { log.error("zlm服务调用失败:{}", throwable.getMessage()); return new RemoteZlmService() { @Override public R releaseSsrc(String mediaServerId, String ssrc, String inner) { return R.fail("zlm接口服务调用失败,releaseSsrc:" + throwable.getMessage()); } @Override public R closeRTPServer(String mediaServerId, RtpServerParam rtpServer, String inner) { return R.fail("zlm接口服务调用失败,closeRTPServer:" + throwable.getMessage()); } @Override public R connectRtpServer(String mediaServerId, String address, int port, String stream, String inner) { return R.fail("zlm接口服务调用失败,connectRtpServer:" + throwable.getMessage()); } }; } }