diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java index a77b294b..3443a87a 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java @@ -24,6 +24,7 @@ import com.genersoft.iot.vmp.service.redisMsg.RedisGbPlayMsgListener; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import com.github.rholder.retry.*; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.InitializingBean; @@ -197,11 +198,13 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In AtomicReference failMag = new AtomicReference<>(""); Retryer retryer = RetryerBuilder.newBuilder() .retryIfResult(resp -> { - if(resp != null && resp.getInteger("code") == -1){ - String msg = resp.getString("msg"); - if(!msg.equalsIgnoreCase(failMag.get())){ - failMag.set(msg); - logger.debug(msg); + if(resp != null){ + if(resp.getInteger("code") != 0){ + String msg = resp.getString("msg"); + if (!msg.equalsIgnoreCase(failMag.get()) && !StringUtils.containsIgnoreCase(msg,"can not find the source stream")) { + failMag.set(msg); + logger.debug("rtp转推失败 {} {}, {}, {}", msg, channelId, mediaInfo, param); + } } } return resp == null || resp.getInteger("code") != 0; @@ -211,13 +214,13 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In // 重试间隔 .withWaitStrategy(WaitStrategies.fixedWait(1, TimeUnit.MILLISECONDS)) // 重试次数 - .withStopStrategy(StopStrategies.stopAfterAttempt(15 * 1000)) + .withStopStrategy(StopStrategies.stopAfterAttempt(10 * 1000)) .build(); try { startSendRtpStreamResult = retryer.call(() -> zlmServerFactory.startSendRtpStream(mediaInfo, param)); logger.info("rtp转推成功 {} {} {}", channelId, mediaInfo, param); } catch (ExecutionException | RetryException e) { - logger.error("rtp转推失败 {} {} {} {}", channelId, mediaInfo, param, e.getMessage()); + logger.error("rtp转推失败 {} {} {} => {} {}", channelId, mediaInfo, param, failMag.get(), e.getMessage()); startSendRtpStreamResult = null; } startSendRtpStreamHand(evt, sendRtpItem, parentPlatform, startSendRtpStreamResult, param, callIdHeader);