Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
spring-projects-issues opened this issue Jul 4, 2014 · 5 comments
Assignees
Labels
type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jul 4, 2014

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:

  • #16566 CachingConnectionFactory doesn't properly cache producers with JMS 2.0
  • #16574 CachingConnectionFactory should allow option to not cache shared consumers
@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 4, 2014

Juergen Hoeller commented

We covered JMS 2.0's createSharedDurableConsumer but apparently forgot to include the regular createSharedConsumer as well. Fixing this for 4.1 RC1 and 4.0.6 now, along with the previous JMS 2.0 related changes. Thanks for pointing all of those out - much appreciated!

Juergen

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 4, 2014

Juergen Hoeller commented

Fixed and available as of the upcoming 4.1.0 and 4.0.6 snapshots.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 4, 2014

Christopher Shannon commented

Thanks Juergen, I'll give the new snapshots a try.

Chris

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 4, 2014

Juergen Hoeller commented

Quick note: I missed to refine ConsumerCacheKey accordingly; fixed now.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 5, 2014

Christopher Shannon commented

Good catch Juergen. I was going over the JMS 2.0 spec in more detail and testing things out and thought of a new feature that might be useful so I created #16574. I'm not sure if this feature is something that belongs in the CachingConnectionFactory or not but thought I would create the issue anyways. Feel free to close it out if it's something that you think isn't necessary.

Chris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug
Projects
None yet
Development

No branches or pull requests

2 participants