Skip to content

CachingConnectionFactory doesn't properly cache all consumers with JMS 2.0 [SPR-11956] #16572

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions