7
我有一個隊列通道和一個帶有從該隊列讀取的輪詢器的服務激活器。我想要配置說「我想要50個線程輪詢該隊列,並且每次輪詢並獲取消息時,在此線程上調用服務激活器指向的服務。」彈簧集成 - 併發服務激活器
該服務沒有@Async
註釋,但是無狀態且安全的以併發方式運行。
下面是否會這樣做?是否有其他的優選方式來實現這一目標?
<int:channel id="titles">
<int:queue/>
</int:channel>
<int:service-activator output-channel="resolvedIds" ref="searchService" method="searchOnTitle" input-channel="titles">
<int:poller fixed-delay="100" time-unit="MILLISECONDS" task-executor="taskExecutor"></int:poller>
</int:service-activator>
<task:executor id="taskExecutor" pool-size="50" keep-alive="120" />