Publisher Confirms and Returns(spring amqp中文翻译)
来源:互联网 发布:小猪微电商系统源码 编辑:程序博客网 时间:2024/06/01 08:47
Publisher Confirms and Returns
The RabbitTemplate
implementation of AmqpTemplate
supports Publisher Confirms and Returns.
rabbittemplate实现了amqptemplate接口,支持Publisher Confirms and Returns。
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
For returned messages,
the template’s mandatory
property must be set to true
, or the mandatory-expression
must evaluate to true
for a particular message.
模板的mandatory属性必须设置为true,或mandatory-expression必须对一个特定的消息评估为true。
This feature requires a CachingConnectionFactory
that has its publisherReturns
property set to true (see the section called “Publisher Confirms and Returns”).
该特性需要将CachingConnectionFactory的publisherReturns属性设置为true。
Returns are sent to to the client by it registering a RabbitTemplate.ReturnCallback
by callingsetReturnCallback(ReturnCallback callback)
.
Returns被 调用setReturnCallback ReturnCallback(ReturnCallback callback),注册RabbitTemplate.ReturnCallback的客户端
The callback must implement this method:
void returnedMessage(Message message, int replyCode, String replyText, String exchange, String routingKey);
Only one ReturnCallback
is supported by each RabbitTemplate
. See also the section called “Reply Timeout”.
一个RabbitTemplate仅支持一个ReturnCallback。
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
the template requires a CachingConnectionFactory
that has its publisherConfirms
property set to true.
template需要将CachingConnectionFactory的publisherConfirms属性设置为true。
Confirms are sent to to the client by it registering a RabbitTemplate.ConfirmCallback
by callingsetConfirmCallback(ConfirmCallback callback)
.
The callback must implement this method:
void confirm(CorrelationData correlationData, boolean ack, String cause);
The CorrelationData
is an object supplied by the client when sending the original message.
CorrelationData是一个客户端提供的原始消息的对象。
The ack
is true for an ack
and false for a nack
.
ack是true返回ack,是false返回nack
For nack
s, the cause may contain a reason for the nack, if it is available when the nack
is generated.
当nack生成时,cause参数有效,它包含一个nack的原因。
An example is when sending a message to a non-existent exchange. In that case the broker closes the channel; the reason for the closure is included in the cause
. cause
was added in version 1.4.
例如,当发送一个消息到不存在的exchange时,broker关闭channel;这个关闭的原因则放在cause中。
Only one ConfirmCallback
is supported by a RabbitTemplate
.
一个RabbitTemplate仅支持一个ConfirmCallback。
原文:http://docs.spring.io/spring-amqp/docs/1.6.1.RELEASE/reference/html/_reference.html#template-confirms
- Publisher Confirms and Returns(spring amqp中文翻译)
- Using RabbitMQ, Spring AMQP and Spring Integration(着重翻译)
- Spring AMQP
- spring配置rabbitMQ(Spring AMQP)
- Spring消息(2)之AMQP(RabbitMQ)
- RabbitMQ学习之:(十一)AMQP.0-10规范,中文翻译1,2,3章 (转载)
- Publisher and printer
- AMQP and Nova
- 【Spring】使用Spring和AMQP发送接收消息(上)
- 【Spring】使用Spring和AMQP发送接收消息(中)
- 【Spring】使用Spring和AMQP发送接收消息(上)
- 【Spring】使用Spring和AMQP发送接收消息(下)
- spring amqp股票交易(一)
- spring amqp股票交易(二)
- spring amqp股票交易(三)
- Spring AMQP-快速入门
- Spring AMQP抽象层
- spring amqp股票交易(四)
- PGM图片格式
- vs常用快捷键整理
- LRU缓存实现(Java)
- Mule与Servicemix比较
- hdu 3549
- Publisher Confirms and Returns(spring amqp中文翻译)
- 排序算法
- SAP 货物移动 BAPI 的简单使用 BAPI_GOODSMVT_CREATE
- POJ 1511 Invitation Cards(双向最短路)
- 源码编译安装httpd及其常见错误
- ActionScript3(AS3)类库学习之(十)——DisplayObject等显示对象基类
- 滑动菜单[slidingMove.html]
- NYOJ 47 过河问题
- 华为笔试题:地铁换乘问题