diff --git a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/executor/MockingExecutor.java b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/executor/MockingExecutor.java index 937e1f4..e3964f2 100644 --- a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/executor/MockingExecutor.java +++ b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/executor/MockingExecutor.java @@ -27,8 +27,8 @@ public class MockingExecutor{ @Bean(EXECUTOR_BEAN_NAME) public ThreadPoolTaskExecutor sipTaskExecutor() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); - executor.setCorePoolSize(CPU_NUM); - executor.setMaxPoolSize(MAX_POOL_SIZE); + executor.setCorePoolSize(CPU_NUM * 2); + executor.setMaxPoolSize(100); executor.setQueueCapacity(10000); executor.setKeepAliveSeconds(30); executor.setThreadNamePrefix(THREAD_NAME_PREFIX); diff --git a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/listener/SipListenerImpl.java b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/listener/SipListenerImpl.java index b040cc4..0c8a076 100644 --- a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/listener/SipListenerImpl.java +++ b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/listener/SipListenerImpl.java @@ -1,9 +1,9 @@ package cn.skcks.docking.gb28181.mocking.core.sip.listener; import cn.skcks.docking.gb28181.common.json.ResponseStatus; -import cn.skcks.docking.gb28181.core.sip.executor.DefaultSipExecutor; import cn.skcks.docking.gb28181.core.sip.listener.SipListener; import cn.skcks.docking.gb28181.core.sip.message.processor.MessageProcessor; +import cn.skcks.docking.gb28181.mocking.core.sip.executor.MockingExecutor; import cn.skcks.docking.gb28181.mocking.core.sip.response.SipResponseBuilder; import cn.skcks.docking.gb28181.mocking.core.sip.sender.SipSender; import gov.nist.javax.sip.message.SIPRequest; @@ -41,7 +41,7 @@ public class SipListenerImpl implements SipListener { @Override - @Async(DefaultSipExecutor.EXECUTOR_BEAN_NAME) + @Async(MockingExecutor.EXECUTOR_BEAN_NAME) public void processRequest(RequestEvent requestEvent) { String method = requestEvent.getRequest().getMethod(); log.debug("传入请求 method => {}", method); @@ -57,7 +57,7 @@ public class SipListenerImpl implements SipListener { } @Override - @Async(DefaultSipExecutor.EXECUTOR_BEAN_NAME) + @Async(MockingExecutor.EXECUTOR_BEAN_NAME) public void processResponse(ResponseEvent responseEvent) { Response response = responseEvent.getResponse(); int status = response.getStatusCode(); diff --git a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/message/subscribe/SipSubscribe.java b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/message/subscribe/SipSubscribe.java index b4ccdcc..7f98777 100644 --- a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/message/subscribe/SipSubscribe.java +++ b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/message/subscribe/SipSubscribe.java @@ -1,7 +1,7 @@ package cn.skcks.docking.gb28181.mocking.core.sip.message.subscribe; -import cn.skcks.docking.gb28181.core.sip.executor.DefaultSipExecutor; import cn.skcks.docking.gb28181.core.sip.message.subscribe.GenericSubscribe; +import cn.skcks.docking.gb28181.mocking.core.sip.executor.MockingExecutor; import gov.nist.javax.sip.message.SIPRequest; import gov.nist.javax.sip.message.SIPResponse; import jakarta.annotation.PostConstruct; @@ -19,7 +19,7 @@ import java.util.concurrent.Executor; @RequiredArgsConstructor @Service public class SipSubscribe { - @Qualifier(DefaultSipExecutor.EXECUTOR_BEAN_NAME) + @Qualifier(MockingExecutor.EXECUTOR_BEAN_NAME) private final Executor executor; private GenericSubscribe registerSubscribe; private GenericSubscribe ackSubscribe;