풀이 고갈되었을 때 SftpGatewayChannel에 매달려있는 파일로 연결되는 서비스 액티베이터에서 스레드가 멈추는 문제가 있습니다. SA가 무효 리턴을 갖는 것과 관련이 있다고 생각합니다. 이는 무언가를 증가시키는 것만으로 정확합니다.서비스 통합 자에 주차 된 스프링 통합 스레드
SftpGateway에 default-reply-timeout을 추가하여이 문제를 해결할 수 있었지만 재시도 조언이 있고 연결 문제가있는 경우 스레드에 시간 초과를 원하지 않기 때문에 이것은 이상적이지 않습니다. . 성공적으로 업로드하고 "Success"Service Activator를 호출 한 후 스레드를 풀로 반환하는 솔루션을 원합니다.
<task:executor id="Tasker" rejection-policy="CALLER_RUNS" pool-size="${MaxThreads}" />
<int:channel id="SftpGatewayChannel">
<int:dispatcher task-executor="Tasker" />
</int:channel>
<int:service-activator id="SegmentStart" input-channel="SftpGatewayChannel" ref="SftpGateway" />
<int:gateway id="SftpGateway" default-request-channel="SftpOutboundChannel" error-channel="ErrorChannel" />
<int:channel id="SftpOutboundChannel" datatype="java.lang.String,java.io.File,byte[]" />
<int-sftp:outbound-channel-adapter id="SftpOutboundAdapter"
session-factory="SftpCachingSessionFactory" channel="SftpOutboundChannel" charset="UTF-8" >
<int-sftp:request-handler-advice-chain>
<ref bean="exponentialRetryAdvice" />
<bean id="SuccessAdvice" class="org.springframework.integration.handler.advice.ExpressionEvaluatingRequestHandlerAdvice" >
<property name="successChannel" ref="SuccessChannel"/>
<property name="onSuccessExpression" value="true"/>
</bean>
</int-sftp:request-handler-advice-chain>
</int-sftp:outbound-channel-adapter>
<int:channel id="ErrorChannel">
<int:interceptors>
<int:wire-tap channel="FailureChannel" />
</int:interceptors>
</int:channel>
<int:channel id="AttemptChannel" />
<int:channel id="SuccessChannel" />
<int:channel id="FailureChannel" />
<int:service-activator id="AttemptMetrics" input-channel="AttemptChannel"
expression="T(MetricsCounter).addAttempt()" />
<int:service-activator id="SuccessMetrics" input-channel="SuccessChannel"
expression="T(MetricsCounter).addSuccesses(inputMessage.Headers.messages.size())" />
<int:service-activator id="FailureMetrics" input-channel="FailureChannel"
expression="T(MetricsCounter).addFailures(payload.getFailedMessage().Headers.messages.size())" />