File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -357,7 +357,8 @@ public void setBatchSize(int batchSize) {
357
357
358
358
/**
359
359
* Set to true to present a list of messages based on the {@link #setBatchSize(int)},
360
- * if the listener supports it.
360
+ * if the listener supports it. This will coerce {@link #setDeBatchingEnabled(boolean)
361
+ * deBatchingEnabled} to true as well.
361
362
* @param consumerBatchEnabled true to create message batches in the container.
362
363
* @since 2.2
363
364
* @see #setBatchSize(int)
@@ -512,8 +513,9 @@ protected final boolean sharedConnectionEnabled() {
512
513
513
514
@ Override
514
515
protected void doInitialize () {
515
- Assert .state (!this .consumerBatchEnabled || isDeBatchingEnabled (),
516
- "When setting 'consumerBatchEnabled' to true, 'deBatchingEnabled' must also be true" );
516
+ if (this .consumerBatchEnabled ) {
517
+ setDeBatchingEnabled (true );
518
+ }
517
519
}
518
520
519
521
@ ManagedMetric (metricType = MetricType .GAUGE )
You can’t perform that action at this time.
0 commit comments