Search code examples
javaapache-camelamazon-sqsaws-sqs-fifo

Put MessageGroupId in Camel SQS FIFO queue


When you need to send a message to a FIFO queue in AWS SQS using Apache Camel, you'll need to put a property named "MessageGroupId". But, we do know that Apache Camel is not always friendly, so how to? We do have docs telling us how to implement AWS SQS in Apache Camel, such like this one Doc, but in terms of MessageGroupId, it does not explains much and don't truly tells we how to put in in the message [at least not in current date of this post].


Solution

  • Since I did not found any answers anywhere, I'll put it here in case you need it too.

    Before send it to your queue, you'll have to put it in the .setProperty tag, e.g. just like this:

    from(....)
       ....
       ....
       .setProperty("CamelAwsMessageGroupId", "YOUR_VALUE")
       .to("YOUR_QUEUE_URI");