Skip to content

Commit c838c70

Browse files
committed
Merge branch '3.0.x' into 3.1.x
Closes spring-projectsgh-37553
2 parents 3803bd9 + e2982a3 commit c838c70

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsProperties.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ public static class Listener {
146146
private AcknowledgeMode acknowledgeMode;
147147

148148
/**
149-
* Minimum number of concurrent consumers.
149+
* Minimum number of concurrent consumers. When max-concurrency is not specified
150+
* the minimum will also be used as the maximum.
150151
*/
151152
private Integer concurrency;
152153

@@ -198,8 +199,7 @@ public String formatConcurrency() {
198199
if (this.concurrency == null) {
199200
return (this.maxConcurrency != null) ? "1-" + this.maxConcurrency : null;
200201
}
201-
return ((this.maxConcurrency != null) ? this.concurrency + "-" + this.maxConcurrency
202-
: String.valueOf(this.concurrency));
202+
return this.concurrency + "-" + ((this.maxConcurrency != null) ? this.maxConcurrency : this.concurrency);
203203
}
204204

205205
public Duration getReceiveTimeout() {

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsPropertiesTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void formatConcurrencyNull() {
4141
void formatConcurrencyOnlyLowerBound() {
4242
JmsProperties properties = new JmsProperties();
4343
properties.getListener().setConcurrency(2);
44-
assertThat(properties.getListener().formatConcurrency()).isEqualTo("2");
44+
assertThat(properties.getListener().formatConcurrency()).isEqualTo("2-2");
4545
}
4646

4747
@Test

0 commit comments

Comments
 (0)