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 with WebLogic JMS not caching producers nor consumers #28500

Closed
rod2j opened this issue May 22, 2022 · 0 comments
Closed
Assignees
Labels
in: messaging Issues in messaging modules (jms, messaging) type: documentation A documentation task
Milestone

Comments

@rod2j
Copy link

rod2j commented May 22, 2022

Versions affected for caching consumers: 3.1.1 (2012) to last 5.x and 6.x
Versions affected for caching producers: 4.3.14 and above for 4.x, 5.0.3 and above for 5.x, 6.x


I just discovered a few days ago, while trying to use some advanced features of WebLogic JMS broker like "Control Flow", that it was not working, because producers were actually not reused, despite the fact I was correctly using a CachingConnectionFactory with JmsTemplate.
The same thing occurs for consumers, for the same reason, even though it seems to me it is probably a less used feature of CachingConnectionFactory, as Spring recommends to not use it for consuming messages with DefaultMessageListenerContainer, and that's probably why this issue was unnoticed or at least not reported for the last 12 years.

Why it doesn't work (and will probably never work) :
Spring 3.1.1 introduced a change in CachingConnectionFactory / CachedSessionInvocationHandler to avoid caching consumers for temporary destinations.
Spring 5.0.3 introduced a very similar change (backported in 4.3.14) to avoid caching producers for temporary destinations in response to issue #20900.

Despite the fact that back in 2006, issue #7440 already reported an issue due to the fact that WebLogic had an awkward implementation of javax.jms.Detination, implementing both javax.jms.Queue and javax.jms.Topic, this was true but not the whole truth:
WebLogic weblogic.jms.common.DestinationImpl (and it is still true in the very last release of WebLogic 14c), does actually implement the 4 interfaces Queue, Topic AND TemporaryQueue and TemporaryTopic.
https://docs.oracle.com/cd/E92951_01/wls/WLAPI/weblogic/jms/common/DestinationImpl.html

The consequence is that it is impossible to distinguish an actual Temporary destination from a Permanent one, using code like the one used in CachingConnectionFactory :

if (!(dest instanceof TemporaryQueue || dest instanceof TemporaryTopic)) {

This behavior cannot be avoided, and is not a bug per se, not a Spring one at least, as it's only due to weird WebLogic Destination implementation.

Nevertheless, I think it would be useful to clearly signal in the chapter dedicated to CachingConnectionFactory in the reference documentation, and probably in the Javadoc as well, that caching producers and consumers features do not work with WebLogic destinations due to some WebLogic limitations, and that one has to code his own "WebLogicCachingConnectionFactory" if he wants to properly cache consumers and or consumers. This is what I'm doing now.

Best regards,

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label May 22, 2022
@jhoeller jhoeller added in: messaging Issues in messaging modules (jms, messaging) type: documentation A documentation task and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels May 22, 2022
@jhoeller jhoeller added this to the 5.3.21 milestone May 22, 2022
@jhoeller jhoeller self-assigned this May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: messaging Issues in messaging modules (jms, messaging) type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

3 participants