我有一个队列通道和一个带有从该队列读取的轮询器的服务激活器。我想要配置说“我想要 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" />