Issue #15210 reports a problem with maxMessagePerTask and CachingConnectionFactory. The result of the issue is javadoc section which discourages CachingConnectionFactory with dynamic scaling. But dynamic scaling described in the javadoc is achieved by method setMaxConcurrentConsumers, not setMaxMessagePerTask.

I can't find issue 15210 details, but CachingConnectionFactory is typical setup in Spring world. For example, the guide https://github.com/spring-guides/gs-messaging-jms creates a context with DefaultMessageListenerContainer + CachingConnectionFactory.

For that reason I assume that DefaultMessageListenerContainer + CachingConnectionFactory + dynamic scaling with setMaxConcurrentConsumers is correct. I deleted misleading Javadoc section and added relevant discouraging section to Javadoc of method setMaxMessagePerTask.

If I am wrong please reject my PR.

Comment From: sbrannen

I've edited your comment to improve the formatting. You might want to check out this Mastering Markdown guide for future reference.