Spring includes a class called CachingConnectionFactory. One variable in this class is a boolean named cacheProducers. By default, this value is true. This variable can be set to false using setCacheProducers(false).
When would it be appropriate to set this to false? What are the benefits and drawbacks of setting to false?
Background: We are conducting a performance test of our application and use Spring JMS to post thousands of messages a second to JMS. Profiling our code, we see that the session.createProducer call is consuming over 60% of our total processing time and the factory is currently set to setCacheProducers(false). What are the consequences to setting this value to true?