Skip to content

Commit a7666ba

Browse files
committed
Merge branch '3.1.x'
Closes spring-projectsgh-37554
2 parents e80f743 + c838c70 commit a7666ba

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

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

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

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

@@ -210,8 +211,8 @@ public String formatConcurrency() {
210211
if (this.minConcurrency == null) {
211212
return (this.maxConcurrency != null) ? "1-" + this.maxConcurrency : null;
212213
}
213-
return ((this.maxConcurrency != null) ? this.minConcurrency + "-" + this.maxConcurrency
214-
: String.valueOf(this.minConcurrency));
214+
return this.minConcurrency + "-"
215+
+ ((this.maxConcurrency != null) ? this.maxConcurrency : this.minConcurrency);
215216
}
216217

217218
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().setMinConcurrency(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)