如何使用camel-aws将消息MessageGroupID和MessageDeduplicationID发送到amazonSQS

问题描述 投票:0回答:1

我们可以使用Java-DSL语法向Amazon SQS“FIFO”队列发送消息:

from("..")..to("aws-sqs://testSQSFifo.fifo?amazonSQSClient=#amazonSQSClient);

请记住:这是一个FIFO队列,因此它需要MessageGroupID和MessageDeduplicationID。

java amazon-sqs apache-camel-aws
1个回答
0
投票

尝试使用以下语法:

from("..")..to("aws-sqs://testSQSFifo.fifo?amazonSQSClient=#amazonSQSClient&messageGroupIdStrategy=STRATEGY);

其中STRATEGY可以是以下选项之一:useConstant,useExchangeId,usePropertyValue。对于usePropertyValue选项,将使用属性CamelAwsMessageGroupId的值。

见:https://github.com/apache/camel/blob/master/components/camel-aws-sqs/src/main/docs/aws-sqs-component.adoc

© www.soinside.com 2019 - 2024. All rights reserved.