/** * Whether the client must receive messages in the order of publication. * <p>By default messages sent to the {@code "clientOutboundChannel"} may * not be processed in the same order because the channel is backed by a * ThreadPoolExecutor that in turn does not guarantee processing in order. * <p>When this flag is set to {@code true} messages within the same session * will be sent to the {@code "clientOutboundChannel"} one at a time in * order to preserve the order of publication. Enable this only if needed * since there is some performance overhead to keep messages in order. * @param preservePublishOrder whether to publish in order * @since 5.1 */ public void setPreservePublishOrder(boolean preservePublishOrder) { OrderedMessageSender.configureOutboundChannel(this.clientOutboundChannel, preservePublishOrder); this.preservePublishOrder = preservePublishOrder; }
@Before public void setup() { this.executor = new ThreadPoolTaskExecutor(); this.executor.setCorePoolSize(Runtime.getRuntime().availableProcessors() * 2); this.executor.setAllowCoreThreadTimeOut(true); this.executor.afterPropertiesSet(); this.channel = new ExecutorSubscribableChannel(this.executor); OrderedMessageSender.configureOutboundChannel(this.channel, true); this.sender = new OrderedMessageSender(this.channel, logger); }
/** * Whether the client must receive messages in the order of publication. * <p>By default messages sent to the {@code "clientOutboundChannel"} may * not be processed in the same order because the channel is backed by a * ThreadPoolExecutor that in turn does not guarantee processing in order. * <p>When this flag is set to {@code true} messages within the same session * will be sent to the {@code "clientOutboundChannel"} one at a time in * order to preserve the order of publication. Enable this only if needed * since there is some performance overhead to keep messages in order. * @param preservePublishOrder whether to publish in order * @since 5.1 */ public void setPreservePublishOrder(boolean preservePublishOrder) { OrderedMessageSender.configureOutboundChannel(this.clientOutboundChannel, preservePublishOrder); this.preservePublishOrder = preservePublishOrder; }
/** * Whether the client must receive messages in the order of publication. * <p>By default messages sent to the {@code "clientOutboundChannel"} may * not be processed in the same order because the channel is backed by a * ThreadPoolExecutor that in turn does not guarantee processing in order. * <p>When this flag is set to {@code true} messages within the same session * will be sent to the {@code "clientOutboundChannel"} one at a time in * order to preserve the order of publication. Enable this only if needed * since there is some performance overhead to keep messages in order. * @param preservePublishOrder whether to publish in order * @since 5.1 */ public void setPreservePublishOrder(boolean preservePublishOrder) { OrderedMessageSender.configureOutboundChannel(this.clientOutboundChannel, preservePublishOrder); this.preservePublishOrder = preservePublishOrder; }
/** * Whether the client must receive messages in the order of publication. * <p>By default messages sent to the {@code "clientOutboundChannel"} may * not be processed in the same order because the channel is backed by a * ThreadPoolExecutor that in turn does not guarantee processing in order. * <p>When this flag is set to {@code true} messages within the same session * will be sent to the {@code "clientOutboundChannel"} one at a time in * order to preserve the order of publication. Enable this only if needed * since there is some performance overhead to keep messages in order. * @param preservePublishOrder whether to publish in order * @since 5.1 */ public void setPreservePublishOrder(boolean preservePublishOrder) { OrderedMessageSender.configureOutboundChannel(this.clientOutboundChannel, preservePublishOrder); this.preservePublishOrder = preservePublishOrder; }