Description
Christopher Shannon opened SPR-11956 and commented
Two new methods in the new JMS 2.0 Session interface are not handled properly by CachedSessionInvocationHandler in CachingConnectionFactory. The method signatures are:
MessageConsumer createSharedConsumer(Topic topic, String sharedSubscriptionName) throws JMSException;
MessageConsumer createSharedConsumer(Topic topic, String sharedSubscriptionName, java.lang.String messageSelector)
throws JMSException;
When calling createSharedConsumer (either method), the CachedSessionInvocationHandler invoke method never delegates to getCachedConsumer like it should and instead delegates to the target. This means that when calling createSharedConsumer, a new consumer will be created each time and will never be cached into the consumers map as they should.
The fix should be straightforward....there just needs to be an else if statement to handle createSharedConsumer method calls and then delegate to getCachedConsumer()
This is related to #16566
Affects: 4.0.5
Issue Links:
- CachingConnectionFactory doesn't properly cache producers with JMS 2.0 [SPR-11949] #16566 CachingConnectionFactory doesn't properly cache producers with JMS 2.0
- CachingConnectionFactory should allow option to not cache shared consumers [SPR-11958] #16574 CachingConnectionFactory should allow option to not cache shared consumers