int-jdbc:inbound-channel-adapter 通道深度

int-jdbc:inbound-channel-adapter channel depth

如果 int-jdbc:inbound-channel-adapter 中配置的通道已满,轮询之后是否发生? 我可以在 int-jdbc:inbound-channel-adapter 中使用队列通道吗? 我的要求是,如果通道已满,则不应进行任何数据库调用,直到通道空闲为止。

您需要使用容量受限的QueueChannel。就任何入站通道适配器使用 MessagingTemplatesendTimeout = -1 而言,QueueChannel 对基础 LinkedBlockingQueue:

执行 put() 操作
/**
 * Inserts the specified element at the tail of this queue, waiting if
 * necessary for space to become available.
 *
 * @throws InterruptedException {@inheritDoc}
 * @throws NullPointerException {@inheritDoc}
 */
public void put(E e) throws InterruptedException {

要确保轮询器在 space 可用之前被阻止,您应该使用 fixed-delay 选项不允许对数据库进行任何并行调用。

所以,换句话说,只要您使用默认选项,到目前为止一切都很好。