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

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -