Merge branch '3.1.x'

Closes gh-37554
This commit is contained in:
Andy Wilkinson 2023-09-22 17:49:23 +01:00
commit a7666ba8a5
2 changed files with 5 additions and 4 deletions

View File

@ -147,7 +147,8 @@ public class JmsProperties {
private AcknowledgeMode acknowledgeMode;
/**
* Minimum number of concurrent consumers.
* Minimum number of concurrent consumers. When max-concurrency is not specified
* the minimum will also be used as the maximum.
*/
private Integer minConcurrency;
@ -210,8 +211,8 @@ public class JmsProperties {
if (this.minConcurrency == null) {
return (this.maxConcurrency != null) ? "1-" + this.maxConcurrency : null;
}
return ((this.maxConcurrency != null) ? this.minConcurrency + "-" + this.maxConcurrency
: String.valueOf(this.minConcurrency));
return this.minConcurrency + "-"
+ ((this.maxConcurrency != null) ? this.maxConcurrency : this.minConcurrency);
}
public Duration getReceiveTimeout() {

View File

@ -41,7 +41,7 @@ class JmsPropertiesTests {
void formatConcurrencyOnlyLowerBound() {
JmsProperties properties = new JmsProperties();
properties.getListener().setMinConcurrency(2);
assertThat(properties.getListener().formatConcurrency()).isEqualTo("2");
assertThat(properties.getListener().formatConcurrency()).isEqualTo("2-2");
}
@Test