Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-12820

SQS: Malformed queue URL due to bad region parsing

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.22.1
    • Fix Version/s: 2.22.2, 2.23.0
    • Component/s: camel-aws
    • Labels:
    • Environment:

      AWS, Centos 7, Java 8, Spring boot 2

    • Estimated Complexity:
      Unknown
    • Regression:
      Regression

      Description

      Diagnosis

      When configuring the component with a queue ARN, for example:

      aws-sqs://arn:aws:sqs:eu-west-1:account-number:queue-name

      The region is being parsed as EU_WEST_1. See https://github.com/apache/camel/blob/master/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsComponent.java#L64

      The region is then used in the construction of the queue URL in https://github.com/apache/camel/blob/master/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java#L132

      This creates a URL pointing to the wrong host: https://sqs.EU_WEST_1.amazonaws.com/account-number/queue-name when the right one should be https://sqs.eu-west-1.amazonaws.com/account-number/queue-name

      Subsequents polls of the sqs component failed due to to this host not being recognised:

      java.net.UnknownHostException: sqs.EU_WEST_1.amazonaws.com

      Proposed solution

      Invoke the getName method instead of toString the https://github.com/apache/camel/blob/master/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsComponent.java#L64

        Attachments

          Activity

            People

            • Assignee:
              acosentino Andrea Cosentino
              Reporter:
              edu2046 Eduardo De Almeida AlmuiƱa
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: