Explicit documentation notes on transacted sessions vs AUTO_ACKNOWLEDGE

Issue: SPR-16487
This commit is contained in:
Juergen Hoeller
2018-02-14 15:32:23 +01:00
parent 3b810f3544
commit 95f7180298
3 changed files with 27 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,6 +41,7 @@ import org.springframework.context.annotation.Import;
* DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
* factory.setConnectionFactory(connectionFactory());
* factory.setDestinationResolver(destinationResolver());
* factory.setSessionTransacted(true);
* factory.setConcurrency("5");
* return factory;
* }

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,6 +33,12 @@ import org.springframework.messaging.handler.annotation.MessageMapping;
* assumed to be available with a bean name of {@code jmsListenerContainerFactory}
* unless an explicit default has been provided through configuration.
*
* <p><b>Consider setting up a custom
* {@link org.springframework.jms.config.DefaultJmsListenerContainerFactory} bean.</b>
* For production purposes, you'll typically fine-tune timeouts and recovery settings.
* Most importantly, the default 'AUTO_ACKNOWLEDGE' mode does not provide reliability
* guarantees, so make sure to use transacted sessions in case of reliability needs.
*
* <p>Processing of {@code @JmsListener} annotations is performed by registering a
* {@link JmsListenerAnnotationBeanPostProcessor}. This can be done manually or,
* more conveniently, through the {@code <jms:annotation-driven/>} element or