파일 처리를 위해 Spring Integration을 사용하고 있습니다. 내 구성은 다음과 같습니다통합 자 채널이 작동하지 않는 큐 채널
<int:channel id="startChannel">
<int:splitter input-channel="startChannel" output-channel="parseChannel" ref="splitter" method="split" />
<int:channel id="parseChannel">
<int:queue size="50"/>
</int:channel>
<int:service-activator input-channel="parseChannel" output-channel="aggregatChannel" ref="process" method="process" />
<int:channel id="aggregateChannel">
<int:queue size="50"/>
</int:channel>
<int:aggregate input-channel="aggregateChannel" output-channel="postProcessingChannel" ...(other attributes) />
<int:channel id="postProcessingChannel">
<int:queue size="50"/>
</int:channel>
<int:channel id="outboundChannel">
<int:queue size="50"/>
</int:channel>
<int:service-activator input-channel="postProcessingChannel" output-channel="outbound-channel" ... />
<int:outbound-adapter channel="outputChannel" ... />
..global poller
..global taskexecutor of size 40
내 구성은 수집기까지 잘 작동합니다. Aggregator는 postProcessingChannel
에 메시지를 넣을 수 있지만 postProcessing 채널에서 읽는 사람은 없습니다.
자세히 살펴보면, - 1) 사후 처리 채널은 용량에 대한 메시지로 채워집니다. 2) 메시지는 postPostProcessing 채널에 메시지를 넣을 수 없으므로 집계 구현에서 스레드가 차단됩니다.
내 질문에 왜 스레드가 PostProcessingchannel에서 읽는 중입니까? JProfiler에서 알 수 있듯이 많은 스레드가 유휴 상태이거나 아무 것도하지 않습니다.
누군가이 문제를 이해할 수 있도록 도와주세요.
아마도'postProcessingChannel'에 대한'service-activator'는'auto-startup = "false"로 표시되어 있을까요? –
No..its는 기본값을 사용합니다. 구성은 애그리 게이터 전후의 서비스 활성화 자에 대해 동일합니다. –
글쎄, 기본 작업 스케줄러의 크기는 10입니다. 모든 "대기열"설계처럼 모든 스케줄러 스레드가 사용 중입니다. 크기를 늘리거나 아키텍처를 다시 생각해보십시오. 큐를 어디서나 사용하지 마십시오. –