Skip to content

v4.0.0

Compare
Choose a tag to compare
@acogoluegnes acogoluegnes released this 23 Nov 17:27
c60388b

Changes between 3.6.x and 4.0.0

RabbitMQ Java Client 4.0.0 doesn't bring any breaking changes to application APIs (e.g. Consumer), the major version upgrade rather marks the decoupling of the Java Client project from the RabbitMQ broker, at least for release cycle and versioning.

This decoupling will make it easier and faster to ship bug fixes and new features. This is also the occasion to adopt semantic versioning.

A few new methods have been added to the Connection, Channel, and RecoveryListener interfaces. These interfaces are more likely to be implemented in libraries (e.g. wrappers of the client) than in applications, but in any case, ensure you add those new methods to your implementation classes.

This release is available from Maven Central.

Enable automatic connection recovery by default

Automatic connection recovery has been there for a few years now, and we know that many users always enable it, so we've decided to enable it by default. You can still choose not to use it, but you'll need to disable it explicitly.

GitHub issue: #214

Logging library integration

SLF4J is now used in several places of the Java Client to report logging messages. It's also used in the default exception handler implementation that ships with the client. This gives the application developer a large choice of logging implementations (e.g. Logback, Log4j) and a large choice of destinations to direct logs to (file, but also logging-specific protocols).

GitHub issue: #114

Add support for metrics

The Java Client can now gather runtime metrics such as number of sent and received messages. The metrics are collected by default through Dropwizard Metrics library, but collection is pluggable if you have some fancy requirements. Using Dropwizard Metrics gives the opportunity to use many monitoring backends out-of-the-box: JMX, Spring Boot metrics endpoint, Ganglia, Graphite, etc.

GitHub issue: #79

Support NIO

The Java Client has been historically using the traditional Java blocking IO library (i.e. Socket and its Input/OutputStreams). This has been working for years, but isn't adapted to all kinds of workloads. Java NIO allows for a more flexible, yet more complex to implement model to handle network communication. Long story short, Java NIO allows to handle more connections with fewer threads (the blocking IO mode always needs one thread per connection). Java NIO is an opt-in and is disabled by default.

This feature is still considered experimental: even though our test suite passes in NIO mode, we haven't got feedback yet from production projects.

GitHub issue: #11

Support dynamic versioning

Now the Java Client isn't tied to RabbitMQ server releases, supporting dynamic versioning is possible. This will make easier for users to know if they can safely upgrade to a new version of the client, if they can benefit from new features, etc.

GitHub issue: #123

Extract Tracer into a separate project

The AMQP Tracer is now hosted in a separate project. See the documentation for more details.

GitHub issue: #204

Extract PerfTest into a separate project

The PerfTest tool is now hosted in a separate project. See the documentation for more details.

GitHub issue: #196

Prevent Socket.write() from blocking

When the connection was lost between the client and the server, the Java Client could block on write operations until the underlying socket was closed by the operating system (after several minutes on Linux). This has been solved by making part of the shutdown sequence asynchronous.

GitHub issue: #194

UnknownChannelException in AMQConnection.MainLoop.run

Corner cases (e.g. channel closed - thus no longer known from the client - with an in-flight delivery) could trigger fatal exceptions. Those cases are now handled and just logged.

GitHub issue: #189

Add Recoverable[Connection/Channel] interfaces

This makes casting and using a recoverable connection/channel a bit easier than casting to either just Recoverable (which just exposes the two methods) or the concrete class.

GitHub issue: #137

Make socket connection to try all DNS record IPs

GitHub issue: #138

Finish transition to Maven

The build doesn't depend on Ant anymore.

GitHub issues: #164, #37

Bump default TLS protocol version to TLS v1.2

TLS v1.2 is used by default only if the client JVM supports it, otherwise the client automatically falls back to TLS v1.0.

GitHub issue: #139

Begin recovery after all shutdown listeners have been given a chance to run

GitHub issue: #135

Enhance RpcClient: Provide access to message metadata

GitHub issue: #134

Contributed by Zac Farrell.

Make Connection implement Closeable interface

GitHub issue: #131

Contributed by Karl "Khazrak" Andersson.

Detailed list of changes.