June 2018
Intermediate to advanced
408 pages
11h 23m
English
For the ConnectionFactory interface, there is a concrete implementation CachingConnectionFactory which, by default, creates a single connection proxy that can be shared by the whole application. The code used to create CachingConnectionFactory is as follows:
@Beanpublic ConnectionFactory connectionFactory() { CachingConnectionFactory connectionFactory = new CachingConnectionFactory("localhost"); connectionFactory.setUsername("guest"); connectionFactory.setPassword("guest"); return connectionFactory;}
We can also configure cached connections using CachingConnectionFactory as well as just channels. We need to set the cacheMode property to CacheMode.CONNECTION using setCacheMode(). We can also limit the total number ...
Read now
Unlock full access