You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 (!(destinstanceofTemporaryQueue || destinstanceofTemporaryTopic)) {
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,
The text was updated successfully, but these errors were encountered:
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 :
spring-framework/spring-jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java
Line 351 in 59c7bb1
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,
The text was updated successfully, but these errors were encountered: