8 Upgrading - Reference Documentation
Authors: Bud Byrd
Version: 3.1.3
8 Upgrading
When an update to the plugin is made that has incompatibility considerations, this document will help identify the various impact considerations when upgrading to a new version.8.1 From 3.0.X
The upgrade from 3.0.X to 3.1.X includes a refactor of how the consumer and connection managers work. The storage of consumer handlers was moved from the connection classes into the consumer manager in order to support the new start/stop functionality, and it made sense for consumer handlers to reside with the appropriately named manager.Both of the managers also now have underlying interfaces that define how a manager should behave. In addition, the objects being managed are now called Contexts, which also have interfaces that define their general behavior. It is the intention that with these changes the plugin becomes more stable with less backwards- compatibility breaking changes being introduced moving forward.Here are the items authors may need to address when upgrading to this version of the plugin.- The
rabbitContext.getConnection()
methods now return the RabbitMQConnection
object instead of theConnectionContext
instance. This was done to make the methods more consistent with thecreateChannel
methods and to encapsulate theConnectionContext
objects inside the manager. TheConnectionContext
objects can now be retrieved from theconsumerManager
bean. - Many of the methods inside of the
ConsumerManager
andConnectionManager
have been renamed to adhere to a common interface. This should only affect projects that use these beans directly. - Some of the methods inside of the
RabbitContext
have been renamed to match the interface used by the various managers.
rabbitContext
or any of the other beans are
not used in their projects.If the use of the plugin's beans is limited to the rabbitContext
, the impact should be minimal,
with some minor changes need to method names and some refactored code if retrieving a ConnectionContext
.
Users that use the other manager beans will need to account for the changed interface implemented by
those beans.
8.2 From 2.0.X
The upgrade from any version in the 2.0.X range to 3.0.X includes a massive refactoring of the internals of the plugin. If users did not extend or override theRabbitContext
, RabbitMessageBuilder
, or any of the other helper classes, the amount of impact is limited to a couple package name changes.Below are the changes that were made, at a high level:
RabbitMessageBuilder
is deprecated. The class still exists and its interface is the same, however, the code in the class has been ripped out and now proxies requests to therabbitMessagePublisher
bean. The builder will be removed at some point in the near future.RabbitContext
used to contain a significant amount of code related to management of message converters, consumers, and connections. That functionality has been broken out into their own respective classes. TheRabbitContext
now serves only as a class to aggregate functionality useful to users of the plugin, and should still be used to simplify interfacing with the plugin rather than using the underlying beans directly.- Introduced the
rabbitMessagePublisher
as a replacement for theRabbitMessageBuilder
. This bean can be injected into other spring managed beans, such as services, controllers, and rabbit consumers. Its functionality follows the builder closely, and users may send messages based on configurations made through closures or through the newRabbitMessageProperties
object. The short-hand convenience methods are still available as well. - Introduced the
messageConverterManager
bean to handle all operations pertaining to message converters. - Introduced the
consumerManager
bean to handle all operations pertaining to message consumers. - Introduced the
connectionManager
bean to handle all operations pertaining to RabbitMQ connections and channels. - Introduced the
queueBuilder
bean to handle creating configured exchanges and queues. - The
MessageContext
class has been moved into a new package:com.budjb.rabbitmq.consumer
. - The
AutoAck
enum has been moved into a new package:com.budjb.rabbitmq.consumer
. - The
ConsumerConfiguration
class has been moved into a new package:com.budjb.rabbitmq.consumer
. - The
MessageConvertMethod
class has been moved into a new package:com.budjb.rabbitmq.consumer
. - The
ConnectionContext
class has been moved into a new package:com.budjb.rabbitmq.connection
. - The
ConnectionConfiguration
class has been moved into a new package:com.budjb.rabbitmq.connection
. - The
MessageConverter
abstract class has been moved into a new package:com.budjb.rabbitmq.converter
. - All of the bundles message converters have been moved into a new package:
com.budjb.rabbitmq.converter
. - The
RabbitMessageBuilder
class has been moved into a new package:com.budjb.rabbitmq.publisher
. - A large amount of unit tests and some integration tests have been added to the project. These tests rely on the Spock mocking framework, but the test files and dependencies are not exported with the plugin so that a new plugin dependency on Spock is not created.
- The closures used for publishing messages have had their resolving strategy changed from
OWNER_FIRST
toDELEGATE_FIRST
. This should not have much of an impact, but in some cases closures may need to explicity qualify some properties in the closures withdelegate
.