Caching Connection Factory for JMS in Spring - PrismoSkills
Caching Connection Factory for JMS in Spring
JMS implementations typically need some kind of connection pooling to pool connections and sessions.
CachingConnectionFactory is one such connection pool implementation provided by spring.
In this article, we go under-the-hoods of the CachingConnectionFactory and see some interesting details on the usage of dynamic-proxy.
Take a moment to browse the code for CachingConnectionFactory.
CachingConnectionFactory extends SingleConnectionFactory.
We will call CachingConnectionFactory as CCF and SingleConnectionFactory as SCF for brevity sake.
SCF.createConnection() calls targetConnectionFactory.createConnection() to get the actual JMS connection.
SCF.getSharedConnectionProxy() then wraps this real connection object into a dynamic proxy whose handler is an instance of SharedConnectionInvocationHandler.
The SharedConnectionInvocationHandler acts like a proxy for the connection and intercepts all its calls by the method:
Read full article from Caching Connection Factory for JMS in Spring - PrismoSkills
No comments:
Post a Comment