是否有人知道AMQP连接器(Mule)的ACK模式中MULE_AUTO
和MANUAL
之间的确切差异。因为我观察到了
在MULE_AUTO和MANUAL中,两种情况都应该从外部删除消息。什么是确切的区别。我错过了什么。
<amqp:connector name="AMQP_Test" validateConnections="true"
host="***" ackMode="MULE_AUTO"
username="123" password="123!" />
任何人都可以帮助我理解它。
第二次编辑:
我将ACK保持为MULE_AUTO
。即使在消耗的服务响应成功响应后,也不会删除消息。不知道我哪里错了
请找到完整的config.xml。
<amqp:connector name="AMQP_Test" validateConnections="true" host="****" username="123" password="123!" ackMode="MULE_AUTO" doc:name="AMQP Connector"/>
<flow name="testrabbitmqFlow1" doc:name="testrabbitmqFlow1" >
<amqp:inbound-endpoint queueName="amqp.test.queue" exchangeDurable="true" queueDurable="true" responseTimeout="1000000" connector-ref="AMQP_Test" doc:name="AMQP">
<amqp:transaction recoverStrategy="REQUEUE" action="ALWAYS_BEGIN"/>
</amqp:inbound-endpoint>
<byte-array-to-string-transformer doc:name="Byte Array to String"/>
<http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="8085" path="test" method="POST" responseTimeout="1000000" doc:name="HTTP"/>
<logger message="value in queue .. #[payload]....#[message.inboundProperties['http.status']]" level="INFO" doc:name="Logger"/>
</flow>
你能告诉我我错过的地方吗?
答案 0 :(得分:3)
使用MANUAL
,您必须手动确认(或拒绝)消息,如下所述:https://github.com/mulesoft/mule-transport-amqp/blob/master/GUIDE.md#manual-message-acknowledgement-and-rejection
实质上,这是通过以下方式完成的:
<amqp:acknowledge-message />
和
<amqp:reject-message requeue="true" />
使用MULE_AUTO
时,Mule应在流程完成处理时自动确认消息。如果它没有这样做,那么它肯定是一个错误。