Skip to content

Commit 945463b

Browse files
committed
Added javadoc note on the use of CachingConnectionFactory
Issue: SPR-10581 (cherry picked from commit 2626a35)
1 parent 3ba3dd6 commit 945463b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

spring-jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,16 @@
9191
* {@code Sessions} and/or the {@code TaskExecutor} does not pool threads (check
9292
* your configuration!). Note that dynamic scaling only really makes sense for a
9393
* queue in the first place; for a topic, you will typically stick with the default
94-
* number of 1 consumer, else you'd receive the same message multiple times on
94+
* number of 1 consumer, otherwise you'd receive the same message multiple times on
9595
* the same node.
9696
*
97+
* <p><b>Note: Don't use Spring's {@link org.springframework.jms.connection.CachingConnectionFactory}
98+
* in combination with dynamic scaling.</b> Ideally, don't use it with a message
99+
* listener container at all, since it is generally preferable to let the
100+
* listener container itself handle appropriate caching within its lifecycle.
101+
* Also, stopping and restarting a listener container will only work with an
102+
* independent, locally cached Connection - not with an externally cached one.
103+
*
97104
* <p><b>It is strongly recommended to either set {@link #setSessionTransacted
98105
* "sessionTransacted"} to "true" or specify an external {@link #setTransactionManager
99106
* "transactionManager"}.</b> See the {@link AbstractMessageListenerContainer}

0 commit comments

Comments
 (0)