Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send message attributes along with message body on AWS sqs using Camel?

i want to send some message attributes to AWS sqs along with message body using camel routes. But only message body is getting sent. I am unable to send message attributes to SQS.Below is my route

from("direct:send-to-sqs")
                .setBody(simple("${exchangeProperty.ENTITY_JSON}"))
                .setProperty("systemName",simple("FINANCE"))
                .log("body which is to be send to sqs is ${body}")
                .to("aws-sqs://{my sqs url}:QueueForPOC?" +
                        "amazonSQSClient=#sqsClient&attributeNames=#systemName")
                .log("entity has been sent to SQS.");

Can anyone please give me some clue and help??

like image 544
Purushottam kumar Avatar asked Dec 04 '25 16:12

Purushottam kumar


1 Answers

Try to use setHeader instead of setProperty

like image 185
Greenev Avatar answered Dec 06 '25 04:12

Greenev