Polish "Add option for configuring max messages per task"
See gh-42341
This commit is contained in:
parent
09b57eff76
commit
e930a963ad
|
@ -187,7 +187,9 @@ public class JmsProperties {
|
|||
private Duration receiveTimeout = Duration.ofSeconds(1);
|
||||
|
||||
/**
|
||||
* Specify the maximum number of messages to process in one task.
|
||||
* Specify the maximum number of messages to process in one task. By default,
|
||||
* unlimited unless a SchedulingTaskExecutor is configured on the listener (10
|
||||
* messages), as it indicates a preference for short-lived tasks.
|
||||
*/
|
||||
private Integer maxMessagesPerTask;
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ class JmsAutoConfigurationTests {
|
|||
"spring.jms.listener.session.transacted=false", "spring.jms.listener.minConcurrency=2",
|
||||
"spring.jms.listener.receiveTimeout=2s", "spring.jms.listener.maxConcurrency=10",
|
||||
"spring.jms.subscription-durable=true", "spring.jms.client-id=exampleId",
|
||||
"spring.jms.listener.max-messages-per-task=10")
|
||||
"spring.jms.listener.max-messages-per-task=5")
|
||||
.run(this::testJmsListenerContainerFactoryWithCustomSettings);
|
||||
}
|
||||
|
||||
|
@ -189,7 +189,7 @@ class JmsAutoConfigurationTests {
|
|||
assertThat(container.getConcurrentConsumers()).isEqualTo(2);
|
||||
assertThat(container.getMaxConcurrentConsumers()).isEqualTo(10);
|
||||
assertThat(container).hasFieldOrPropertyWithValue("receiveTimeout", 2000L);
|
||||
assertThat(container).hasFieldOrPropertyWithValue("maxMessagesPerTask", 10);
|
||||
assertThat(container).hasFieldOrPropertyWithValue("maxMessagesPerTask", 5);
|
||||
assertThat(container.isSubscriptionDurable()).isTrue();
|
||||
assertThat(container.getClientId()).isEqualTo("exampleId");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue