Changes in 1.3 Since 1.2

  • 基于工作负载动态扩展侦听器并发性

  • 允许在运行时修改侦听器队列

  • 引入用户参数以设置 x-priority

  • 允许配置单个排他用户以阻止其他用户侦听队列

  • 提供同步接收和回复方法

  • 支持配置重试模板以尝试在代理不可用时进行重试

  • 允许缓存连接和通道实例,而不是仅缓存通道实例

  • 支持在 exchange 绑定中解析绑定参数

  • 提供 Fluent API 用于构建消息和消息属性

  • 引入一个新的默认错误处理程序,用于检测致命的消息转换问题

Listener Concurrency

现在,侦听器容器支持基于工作负载动态扩展使用者数量,或者您可以以编程方式更改并发而不停止容器。请参阅 Listener Concurrency

The listener container now supports dynamic scaling of the number of consumers based on workload, or you can programmatically change the concurrency without stopping the container. See Listener Concurrency.

Listener Queues

现在,侦听器容器允许修改其侦听的队列的运行时。此外,只要容器的一个配置队列可用,容器现在就会启动。请参阅 Listener Queues

The listener container now permits the queues on which it listens to be modified at runtime. Also, the container now starts if at least one of its configured queues is available for use. See Listener Queues

该侦听器容器现在在启动期间重新声明任何自动删除队列。参见 xref:amqp/receiving-messages/async-consumer.adoc#lc-auto-delete[auto-delete 队列。

This listener container now redeclares any auto-delete queues during startup. See auto-delete Queues.

Consumer Priority

现在,侦听器容器支持使用者参数,允许设置 x-priority 参数。请参阅 Consumer Priority

The listener container now supports consumer arguments, letting the x-priority argument be set. See Consumer Priority.

Exclusive Consumer

现在,您可以使用单个 exclusive 使用者配置 SimpleMessageListenerContainer,以阻止其他使用者侦听该队列。请参阅 Exclusive Consumer

You can now configure SimpleMessageListenerContainer with a single exclusive consumer, preventing other consumers from listening to the queue. See Exclusive Consumer.

Rabbit Admin

现在,您可以让代理生成队列名称,而不管 durableautoDeleteexclusive 设置如何。请参阅 Configuring the Broker

You can now have the broker generate the queue name, regardless of durable, autoDelete, and exclusive settings. See Configuring the Broker.

Direct Exchange Binding

以前,从 direct-exchange 配置的 binding 元素中省略 key 属性会导致队列或交换机以一个空字符串作为路由键进行绑定。现在,它以提供的 QueueExchange 的名称进行绑定。如果您希望使用空字符串路由键进行绑定,则需要指定 key=""

Previously, omitting the key attribute from a binding element of a direct-exchange configuration caused the queue or exchange to be bound with an empty string as the routing key. Now it is bound with the the name of the provided Queue or Exchange. If you wish to bind with an empty string routing key, you need to specify key="".

AmqpTemplate Changes

AmqpTemplate 现在提供几个同步 receiveAndReply 方法。这些方法由 RabbitTemplate 实现。有关详细信息,请参阅 [receiving-messages]

The AmqpTemplate now provides several synchronous receiveAndReply methods. These are implemented by the RabbitTemplate. For more information see [receiving-messages].

`RabbitTemplate`现在支持配置一个 `RetryTemplate`以在代理不可用时尝试重试(带有可选延迟策略)。有关详细信息,请参见 Adding Retry Capabilities

The RabbitTemplate now supports configuring a RetryTemplate to attempt retries (with optional back-off policy) for when the broker is not available. For more information see Adding Retry Capabilities.

Caching Connection Factory

现在,您可以将缓存连接工厂配置为缓存 Connection 实例及其实 Channel 实例,而不是使用一个连接且只缓存 Channel 实例。请参阅 Connection and Resource Management

You can now configure the caching connection factory to cache Connection instances and their Channel instances instead of using a single connection and caching only Channel instances. See Connection and Resource Management.

Binding Arguments

<exchange>`的 `<binding>`现在支持对 `<binding-arguments>`子元素进行解析。您现在可以使用 `key/value`属性对(匹配单个标头)或 `<binding-arguments>`子元素(允许在多个标头上进行匹配)配置 `<binding>`的 `<headers-exchange>。这些选项互斥。请参见 Headers Exchange

The <binding> of the <exchange> now supports parsing of the <binding-arguments> sub-element. You can now configure the <binding> of the <headers-exchange> with a key/value attribute pair (to match on a single header) or with a <binding-arguments> sub-element (allowing matching on multiple headers). These options are mutually exclusive. See Headers Exchange.

Routing Connection Factory

已引入一个新的 SimpleRoutingConnectionFactory。它允许配置 ConnectionFactories 映射,以确定在运行时要使用的目标 ConnectionFactory。请参阅 Routing Connection Factory

A new SimpleRoutingConnectionFactory has been introduced. It allows configuration of ConnectionFactories mapping, to determine the target ConnectionFactory to use at runtime. See Routing Connection Factory.

MessageBuilder and MessagePropertiesBuilder

现在提供了用于构建消息或消息属性的 “Fluent APIs”。请参见 Message Builder API

“Fluent APIs” for building messages or message properties are now provided. See Message Builder API.

RetryInterceptorBuilder Change

现在提供了一个用于构建侦听容器重试拦截器的 “Fluent API”。请参见 Failures in Synchronous Operations and Options for Retry

A “Fluent API” for building listener container retry interceptors is now provided. See Failures in Synchronous Operations and Options for Retry.

RepublishMessageRecoverer Added

当重试耗尽时,提供了这个新的 `MessageRecoverer`来允许将失败的消息发布到另一个队列(在标头中包括堆栈跟踪信息)。请参见 Message Listeners and the Asynchronous Case

This new MessageRecoverer is provided to allow publishing a failed message to another queue (including stack trace information in the header) when retries are exhausted. See Message Listeners and the Asynchronous Case.

Default Error Handler (Since 1.3.2)

已将一个默认 `ConditionalRejectingErrorHandler`添加到侦听器容器中。此错误处理程序检测到致命的消息转换问题,并指示容器拒绝该消息,以防止代理连续重新传递不可转换消息。请参阅 Exception Handling

A default ConditionalRejectingErrorHandler has been added to the listener container. This error handler detects fatal message conversion problems and instructs the container to reject the message to prevent the broker from continually redelivering the unconvertible message. See Exception Handling.

Listener Container 'missingQueuesFatal` Property (Since 1.3.5)

SimpleMessageListenerContainer`现在具有一个名为 `missingQueuesFatal`的属性(默认值: `true)。以前,缺少队列总是致命的。请参阅 Message Listener Container Configuration

The SimpleMessageListenerContainer now has a property called missingQueuesFatal (default: true). Previously, missing queues were always fatal. See Message Listener Container Configuration.