amazon sqs - Camel doesn't retrieve SQS messages attributes -
here route:
from("aws-sqs://myqueue?accesskey=raw(xxx)&secretkey=raw(yyy)&deleteafterread=false") .log("attributes: ${header.camelawssqsattributes}") .process(new processor() { @override public void process(exchange exchange) throws exception { map<string, string> messageattributes = (map<string, string>) exchange.getin().getheader("camelawssqsattributes"); ... } }); the .log() shows empty map if print messageattributes processor.
i tried header "camelawssqsmessageattributes" instead of "camelawssqsattributes" still nothing.
i see attributes aws console though.
way message body, , use camel 2.15
i figured out, here example queue attributes , message attributes:
main.bind("sqsattributenames", collections.singletonlist("all")); main.bind("sqsmessageattributenames", collections.singletonlist("all")); or add objects registry if don't use org.apache.camel.main.main
then:
from("aws-sqs://myqueue?accesskey=raw(xxx)&secretkey=raw(yyy)&deleteafterread=false&attributenames=#sqsattributenames&messageattributenames=#sqsmessageattributenames") of course can replace collections.singletonlist("all") list of attributes need if don't want of them.
Comments
Post a Comment