Changes in 2.3 Since 2.2

本部分介绍了版本 2.2 和版本 2.3 之间的变更。有关以前版本中的变更,请参阅 Change History

This section describes the changes between version 2.2 and version 2.3. See Change History for changes in previous versions.

Connection Factory Changes

现在提供了两个附加连接工厂。有关详细信息,请参见 Choosing a Connection Factory

Two additional connection factories are now provided. See Choosing a Connection Factory for more information.

@RabbitListener Changes

现在您可以指定回复内容类型。有关详细信息,请参阅 Reply ContentType

You can now specify a reply content type. See Reply ContentType for more information.

Message Converter Changes

如果使用自定义解串器配置了 ObjectMapper,那么 Jackson2JMessageConverter 现在能够反序列化抽象类(包括接口)。有关详细信息,请参见 Deserializing Abstract Classes

The Jackson2JMessageConverter s can now deserialize abstract classes (including interfaces) if the ObjectMapper is configured with a custom deserializer. See Deserializing Abstract Classes for more information.

Testing Changes

提供了一个新的注释 @SpringRabbitTest 用于在你未使用 SpringBootTest 时自动配置一些基础结构 bean。更多信息,请参阅 @SpringRabbitTest

A new annotation @SpringRabbitTest is provided to automatically configure some infrastructure beans for when you are not using SpringBootTest. See @SpringRabbitTest for more information.

RabbitTemplate Changes

模板的 ReturnCallback 已被重构为 ReturnsCallback ,以便在 lambda 表达式中更简单地使用。更多信息,请参阅 Correlated Publisher Confirms and Returns

The template’s ReturnCallback has been refactored as ReturnsCallback for simpler use in lambda expressions. See Correlated Publisher Confirms and Returns for more information.

在使用返回确认和关联确认时, CorrelationData 现在需要一个唯一的 id 属性。更多信息,请参阅 Correlated Publisher Confirms and Returns

When using returns and correlated confirms, the CorrelationData now requires a unique id property. See Correlated Publisher Confirms and Returns for more information.

在使用直接回复时,你现在可以配置模板,这样服务器就不需要在答复中返回关联数据。更多信息,请参阅 RabbitMQ Direct reply-to

When using direct reply-to, you can now configure the template such that the server does not need to return correlation data with the reply. See RabbitMQ Direct reply-to for more information.

Listener Container Changes

现在提供了新的侦听器容器属性 consumeDelay;在使用 RabbitMQ Sharding Plugin 时它会有所帮助。

A new listener container property consumeDelay is now available; it is helpful when using the RabbitMQ Sharding Plugin.

默认的 JavaLangErrorHandler 现在会调用 System.exit(99)。要恢复以前的行为(什么都不做),请添加一个空操作处理程序。

The default JavaLangErrorHandler now calls System.exit(99). To revert to the previous behavior (do nothing), add a no-op handler.

容器现在支持 globalQos 属性,以便针对整个通道应用 prefetchCount,而不是针对通道上的每个使用者应用。

The containers now support the globalQos property to apply the prefetchCount globally for the channel rather than for each consumer on the channel.

有关详细信息,请参阅 Message Listener Container Configuration

See Message Listener Container Configuration for more information.

MessagePostProcessor Changes

压缩 MessagePostProcessor 现在使用逗号来分隔多个内容编码,而不是冒号。解压缩器可以处理这两种格式,但是,如果您使用此版本生成的消息被早于 2.2.12 的版本使用,则应将压缩器配置为使用旧分隔符。有关详细信息,请参阅 Modifying Messages - Compression and More 中的重要说明。

The compressing MessagePostProcessor s now use a comma to separate multiple content encodings instead of a colon. The decompressors can handle both formats but, if you produce messages with this version that are consumed by versions earlier than 2.2.12, you should configure the compressor to use the old delimiter. See the IMPORTANT note in Modifying Messages - Compression and More for more information.

Multiple Broker Support Improvements

有关详细信息,请参阅 Multiple Broker (or Cluster) Support

See Multiple Broker (or Cluster) Support for more information.

RepublishMessageRecoverer Changes

没有提供支持发布者确认的此恢复器的子类。更多信息,请参阅 Message Listeners and the Asynchronous Case

A new subclass of this recoverer is not provided that supports publisher confirms. See Message Listeners and the Asynchronous Case for more information.