Merge branch '3.1.x'

Closes gh-37554
pull/37559/head
Andy Wilkinson 1 year ago
commit a7666ba8a5

@ -147,7 +147,8 @@ public class JmsProperties {
private AcknowledgeMode acknowledgeMode; 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; private Integer minConcurrency;
@ -210,8 +211,8 @@ public class JmsProperties {
if (this.minConcurrency == null) { if (this.minConcurrency == null) {
return (this.maxConcurrency != null) ? "1-" + this.maxConcurrency : null; return (this.maxConcurrency != null) ? "1-" + this.maxConcurrency : null;
} }
return ((this.maxConcurrency != null) ? this.minConcurrency + "-" + this.maxConcurrency return this.minConcurrency + "-"
: String.valueOf(this.minConcurrency)); + ((this.maxConcurrency != null) ? this.maxConcurrency : this.minConcurrency);
} }
public Duration getReceiveTimeout() { public Duration getReceiveTimeout() {

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

Loading…
Cancel
Save