camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scurtis-engineer <curtisse...@gmail.com>
Subject CamelAwsSqsMessageAttributes header not appearing on messages in AWS SQS Queue - Camel 2.15.2
Date Fri, 25 Sep 2015 18:53:39 GMT
I have read seemingly every SO question response, and posted my own question
there that no one has answered up to this point, and I am about to tear my
hair out in frustration! :)

Using Camel Blueprint, v. 2.15.2, I have a route defined in the XML in which
I am attempting to set the CamelAwsSqsMessageAttributes header in order to
pass along some message metadata to an SQS queue on the other end. This is
running on a Servicemix v. 5.3.0 box. Here are a couple of code snippets:



Note: in the errorAttributeList, I have tried all kinds of values because it
wasn't clear exactly what I should I be putting there. I have put "All,
CustomErrorWhatnot, *",etc.

Here's the ErrorProcessor bean process method:

public void process(Exchange exchange) throws Exception {
        this.setSQSClient(exchange);

        //reset the body
        String originalBody = exchange.getProperty("originalBodyFromQueue",
String.class);
        //get the error
        String errorProp = exchange.getProperty("errorMessage",
String.class);

        exchange.getIn().setBody(originalBody);

        LOGGER.info("processing error for message with body: {}, and error:
{}", exchange.getIn().getBody(), errorProp);

        Map<String, String> msgAttrs = new HashMap<>();
        msgAttrs.put("SomeError", errorProp.replaceAll(":"," "));

        exchange.getIn().setHeader("CamelAwsSqsMessageAttributes",
msgAttrs);
}


The logging messages verify that the error message is there, the header is
set appropriately in the route once the process method has completed, and it
exists on that end. But when I view the message in the AWS console, the only
header I see is breadcrumbId, like so:

<http://camel.465427.n5.nabble.com/file/n5771992/MessageInTheConsole.png> 

Am I doing something wrong in the URI/setup in the route? Are the headers
lost outside of the context in which they are set? I have seen other posts
that indicate that's the case with *CUSTOM* message properties and headers,
but it seems that Camel headers should persist. Please help before all my
hair is gone!



--
View this message in context: http://camel.465427.n5.nabble.com/CamelAwsSqsMessageAttributes-header-not-appearing-on-messages-in-AWS-SQS-Queue-Camel-2-15-2-tp5771992.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message