From the course: Spring: Messaging with JMS
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Connection configuration using CachedConnectionFactory - Spring Tutorial
From the course: Spring: Messaging with JMS
Connection configuration using CachedConnectionFactory
- [Instructor] CachingConnectionFactory is the third way we look at configuring a connection to a MAM. The CachingConnectionFactory is a subclass of the SingleConnectionFactory. It too returns the same connection for all creatConnection calls, as well as ignores Connection.close. CachingConnectionFactory, similarly, is thread-safe and the spring API says that RecconectonException flag is defaulted to true for CachingConnectionFactory, which is the opposite of the single connection factory. The CachingConnectionFactory allows optionally caching of consumers and producers. On startup, if not changed, it will only cache one session, but you can however change this session size. Let's open our JMS config, and locate the connection factory. We'll change our return type from SingleConnectionFactory to... CachingConnectionFactory. We'll also change the SingleConnectionFactory object to CachingConnectionFactory. We'll comment out the set reconnect on exception, because this is set to true by…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Connection configuration practices with application properties4m 41s
-
(Locked)
Connection configuration using SingleConnectionFactory6m 8s
-
(Locked)
Connection configuration using CachedConnectionFactory2m 24s
-
(Locked)
Transaction management with Spring JMS (transactions)4m 24s
-
(Locked)
Transaction management with dead letter queue7m 7s
-
(Locked)
-
-