camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Is RAW() required in message endpoint URI with percent-endcoded special characters?
Date Tue, 18 Mar 2014 16:12:38 GMT
On Tue, Mar 18, 2014 at 5:03 PM, Phil Mocek <> wrote:
> On March 13, 2014, Phil Mocek wrote:
>> Must percent-encoded special characters in a Camel message endpoint URI
>> be wrapped in RAW() in order for Camel to correctly process the URI?
> Nobody answered my question.  Off-list last week, I e-mailed Camel
> contributor Claus Ibsen, who is named in relevant tickets, but did not
> receive any response from him.  I am unauthorized to comment in the
> Camel issue tracking system.

See last bullet in "how to get help" section at

Apache is a 100% open community, and its important that all
conversation happens in the open, and on Apache infrastructure (eg
mailing list / JIRA / etc) - so everybody can follow.

> It seems that the answer is "yes," and that the Camel documentation does
> not reflect this.  I still hope to learn whether Camel's aws-sqs URI
> scheme syntax (and maybe that of other schemes) has changed or if this
> requirement is the result of the bug described in CAMEL-4954.
> Following is the related guidance I provided to developers at my
> place of business:
> Since v2.9.0 or earlier, Camel has had [a bug][1] that causes it
> to process some message endpoint URIs incorrectly (in particular,
> those URIs that include [percent-encoded][2] [reserved
> characters][3]).  As a workaround, one can use a slightly
> different URI syntax.
> According to the seemingly-outdated [Camel documentation of its
> aws-sqs scheme][4], given the following:
>     Queue name:     my-sqs-queue
>     AWS access key: AKIADKB5LS3V6L9XWB2
>     AWS secret key: wvAUnoM+RLZzdWmyBDI/dLRGEHa8BY57sKjy0tXO
> the URI that should be used to configure an application for use of
> this queue as a message channel is:
> <aws-sqs://my-sqs-queue?accessKey=AKIADKB5LS3V6L9XWB2&secretKey=wvAUnoM%2BRLZzdWmyBDI%2FdLRGEHa8BY57sKjy0tXO>
> Instead, we'll use:
> <aws-sqs://my-sqs-queue?accessKey=AKIADKB5LS3V6L9XWB2&secretKey=RAW(wvAUnoM%2BRLZzdWmyBDI%2FdLRGEHa8BY57sKjy0tXO)>
> The "+" and "/" characters, which sometimes occur in AWS secret
> keys, have special meaning in URIs (i.e., they are reserved for
> special use in the URI definition), so we percent-encode them in
> our aws-sqs URIs just as we would in a URI of any other scheme.
> Camel does not handle the result of that encoding correctly, so we
> enclose it it in "RAW(" and ")".
> RAW() was [added with Camel 2.11][5].

You can configure endpoints in many ways in Camel. For example using
plain java code, with getter/setter etc. But most people favor using
the uri syntax directly in their routes.
And when you do that then care should be taken when using special
characters like + and % signs etc.

The RAW() syntax tells Camel to leave the uri normalized out of that
part, and the user want the data as-is.

So if your AWS keys are using such chars, then RAW is the correct way
to do that, if you configure using uri style.

And Apache loves contributions, so you are welcome to fix/help with
the docs, in case you think the AWS page need some help

For example from the user guide there is the "how do i configure endpoints"

which documents the RAW () in endpoint uri style

> References:
>  [1]: <>
>       "CAMEL-4954: Camel 2.9.0 incapable of working with % in endpoint URIs"
>  [2]: <>
>       "IETF STD 66: URI Generic Syntax: 2.1. Percent-Encoding"
>  [3]: <>
>       "IETF STD 66: URI Generic Syntax: 2.2. Reserved Characters"
>  [4]: <>
>       "Apache Camel > Documentation > Components > AWS > AWS-SQS > URI
> Format"
>  [5]: <>
>       "Camel 2.11.0 release notes"
> --
> Phil Mocek

Claus Ibsen
Red Hat, Inc.
Twitter: davsclaus
Author of Camel in Action:
Make your Camel applications look hawt, try:

View raw message