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.

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].


References:

 [1]: <https://issues.apache.org/jira/browse/CAMEL-4954>
      "CAMEL-4954: Camel 2.9.0 incapable of working with % in endpoint URIs"
 [2]: <https://tools.ietf.org/html/std66#section-2.1>
      "IETF STD 66: URI Generic Syntax: 2.1. Percent-Encoding"
 [3]: <https://tools.ietf.org/html/std66#section-2.2>
      "IETF STD 66: URI Generic Syntax: 2.2. Reserved Characters"
 [4]: <https://camel.apache.org/aws-sqs#AWS-SQS-URIFormat>
      "Apache Camel > Documentation > Components > AWS > AWS-SQS > URI
Format"
 [5]: <https://camel.apache.org/camel-2110-release.html>
      "Camel 2.11.0 release notes"

-- 
Phil Mocek
http://mocek.org

Reply via email to