java是单线程的spring集成通道吗?
如果我有一个rest服务,我肯定每个请求都由一个单独的线程处理,线程可以并行运行
如果在spring集成中使用rest(http)服务作为入站通道,会发生什么。每个请求是否仍将被并行处理,或者请求将被放置在队列中。。。它将更像是单线程的
你可以在下面搜索框中键入要查询的问题!
如果我有一个rest服务,我肯定每个请求都由一个单独的线程处理,线程可以并行运行
如果在spring集成中使用rest(http)服务作为入站通道,会发生什么。每个请求是否仍将被并行处理,或者请求将被放置在队列中。。。它将更像是单线程的
# 1 楼答案
普通通道(DirectChannel)使用与将某些内容放入通道的对象相同的执行线程(它们基本上是抽象方法调用的一种方式),因此它们是多线程的
从docs开始:
编辑
你的问题很有道理。在通道中设置队列元素时,spring会自动将其转换为QueueChannel(documentation),就我所知,一次只有一个线程能够从队列中使用。如果您想要“真正的”队列语义(几个生产者和消费者线程),可以使用ExecutorChannel