diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractMessageGroupStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractMessageGroupStore.java index 7074f3463b..638decb3e0 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractMessageGroupStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractMessageGroupStore.java @@ -62,10 +62,14 @@ public abstract class AbstractMessageGroupStore extends AbstractBatchingMessageG private boolean lazyLoadMessageGroups = true; - public AbstractMessageGroupStore() { + protected AbstractMessageGroupStore() { super(); } + protected AbstractMessageGroupStore(boolean lazyLoadMessageGroups) { + this.lazyLoadMessageGroups = lazyLoadMessageGroups; + } + @Override public final void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java index ff2a6c2cf6..4e37c45272 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java @@ -121,18 +121,14 @@ public class SimpleMessageStore extends AbstractMessageGroupStore * @since 4.3 */ public SimpleMessageStore(int individualCapacity, int groupCapacity, long upperBoundTimeout, - LockRegistry lockRegistry) { + LockRegistry lockRegistry) { + super(false); Assert.notNull(lockRegistry, "The LockRegistry cannot be null"); this.individualUpperBound = new UpperBound(individualCapacity); this.individualCapacity = individualCapacity; this.groupCapacity = groupCapacity; this.lockRegistry = lockRegistry; this.upperBoundTimeout = upperBoundTimeout; - disableLazyLoadMessageGroups(); - } - - private void disableLazyLoadMessageGroups() { - super.setLazyLoadMessageGroups(false); } /**