diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/ThreadStatePropagationChannelInterceptor.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/ThreadStatePropagationChannelInterceptor.java index 19408c21249..21cbeecbe1a 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/ThreadStatePropagationChannelInterceptor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/ThreadStatePropagationChannelInterceptor.java @@ -16,8 +16,8 @@ package org.springframework.integration.channel.interceptor; -import java.util.LinkedList; import java.util.Queue; +import java.util.concurrent.LinkedBlockingQueue; import io.micrometer.common.lang.Nullable; @@ -105,14 +105,14 @@ private static final class MessageWithThreadState implements Message, Me private final Queue stateQueue; MessageWithThreadState(Message message, Object state) { - this(message, new LinkedList<>()); + this(message, new LinkedBlockingQueue<>()); this.stateQueue.add(state); } @SuppressWarnings("unchecked") private MessageWithThreadState(Message message, Queue stateQueue) { this.message = (Message) message; - this.stateQueue = new LinkedList<>(stateQueue); + this.stateQueue = new LinkedBlockingQueue<>(stateQueue); } @Override