Closes gh-3519
This commit is contained in:
Stephane Nicoll 2015-07-16 15:28:24 +02:00
parent 812f8c8110
commit 4aace564a2
4 changed files with 14 additions and 14 deletions

View File

@ -68,8 +68,8 @@ class JmsAnnotationDrivenConfiguration {
factory.setDestinationResolver(this.destinationResolver); factory.setDestinationResolver(this.destinationResolver);
} }
JmsProperties.Listener listener = this.properties.getListener(); JmsProperties.Listener listener = this.properties.getListener();
if (listener.getAcknowledgmentMode() != null) { if (listener.getAcknowledgeMode() != null) {
factory.setSessionAcknowledgeMode(listener.getAcknowledgmentMode().getMode()); factory.setSessionAcknowledgeMode(listener.getAcknowledgeMode().getMode());
} }
String concurrency = listener.formatConcurrency(); String concurrency = listener.formatConcurrency();
if (concurrency != null) { if (concurrency != null) {

View File

@ -63,10 +63,10 @@ public class JmsProperties {
public static class Listener { public static class Listener {
/** /**
* Acknowledgment mode of the container. By default, the listener is * Acknowledge mode of the container. By default, the listener is
* transacted with automatic acknowledgment. * transacted with automatic acknowledgment.
*/ */
private AcknowledgmentMode acknowledgmentMode; private AcknowledgeMode acknowledgeMode;
/** /**
* Minimum number of concurrent consumers. * Minimum number of concurrent consumers.
@ -78,12 +78,12 @@ public class JmsProperties {
*/ */
private Integer maxConcurrency; private Integer maxConcurrency;
public AcknowledgmentMode getAcknowledgmentMode() { public AcknowledgeMode getAcknowledgeMode() {
return acknowledgmentMode; return acknowledgeMode;
} }
public void setAcknowledgmentMode(AcknowledgmentMode acknowledgmentMode) { public void setAcknowledgeMode(AcknowledgeMode acknowledgeMode) {
this.acknowledgmentMode = acknowledgmentMode; this.acknowledgeMode = acknowledgeMode;
} }
public Integer getConcurrency() { public Integer getConcurrency() {
@ -112,12 +112,12 @@ public class JmsProperties {
} }
/** /**
* Translate the acknowledgment modes defined on the {@link javax.jms.Session}. * Translate the acknowledge modes defined on the {@link javax.jms.Session}.
* *
* <p>{@link javax.jms.Session#SESSION_TRANSACTED} is not defined as we take * <p>{@link javax.jms.Session#SESSION_TRANSACTED} is not defined as we take
* care of this already via a call to {@code setSessionTransacted}. * care of this already via a call to {@code setSessionTransacted}.
*/ */
public enum AcknowledgmentMode { public enum AcknowledgeMode {
/** /**
* Messages sent or received from the session are automatically acknowledged. This * Messages sent or received from the session are automatically acknowledged. This
@ -141,7 +141,7 @@ public class JmsProperties {
private final int mode; private final int mode;
AcknowledgmentMode(int mode) { AcknowledgeMode(int mode) {
this.mode = mode; this.mode = mode;
} }

View File

@ -147,7 +147,7 @@ public class JmsAutoConfigurationTests {
@Test @Test
public void testJmsListenerContainerFactoryWithCustomSettings() { public void testJmsListenerContainerFactoryWithCustomSettings() {
load(EnableJmsConfiguration.class, load(EnableJmsConfiguration.class,
"spring.jms.listener.acknowledgmentMode=client", "spring.jms.listener.acknowledgeMode=client",
"spring.jms.listener.concurrency=2", "spring.jms.listener.concurrency=2",
"spring.jms.listener.maxConcurrency=10"); "spring.jms.listener.maxConcurrency=10");
JmsListenerContainerFactory<?> jmsListenerContainerFactory = this.context JmsListenerContainerFactory<?> jmsListenerContainerFactory = this.context

View File

@ -528,9 +528,9 @@ content into your application; rather pick only the properties that you need.
# JMS ({sc-spring-boot-autoconfigure}/jms/JmsProperties.{sc-ext}[JmsProperties]) # JMS ({sc-spring-boot-autoconfigure}/jms/JmsProperties.{sc-ext}[JmsProperties])
spring.jms.jndi-name= # JNDI location of a JMS ConnectionFactory spring.jms.jndi-name= # JNDI location of a JMS ConnectionFactory
spring.jms.listener.acknowledgment-mode= # session acknowledgment mode spring.jms.listener.acknowledge-mode= # session acknowledgment mode
spring.jms.listener.concurrency= # minimum number of concurrent consumers spring.jms.listener.concurrency= # minimum number of concurrent consumers
spring.jms.listener.maxConcurrency= # maximum number of concurrent consumers spring.jms.listener.max-concurrency= # maximum number of concurrent consumers
spring.jms.pub-sub-domain= # false for queue (default), true for topic spring.jms.pub-sub-domain= # false for queue (default), true for topic
# Email ({sc-spring-boot-autoconfigure}/mail/MailProperties.{sc-ext}[MailProperties]) # Email ({sc-spring-boot-autoconfigure}/mail/MailProperties.{sc-ext}[MailProperties])