[ 
https://issues.apache.org/jira/browse/CAMEL-12647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16542624#comment-16542624
 ] 

ASF GitHub Bot commented on CAMEL-12647:
----------------------------------------

saravanakumar1987 commented on a change in pull request #2424: CAMEL-12647 : 
Problem in setting region for camel AWS-SQS endpoint
URL: https://github.com/apache/camel/pull/2424#discussion_r202260036
 
 

 ##########
 File path: 
components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java
 ##########
 @@ -73,9 +73,9 @@ public void createEndpointWithMinimalArnConfiguration() 
throws Exception {
         
         ((JndiRegistry) ((PropertyPlaceholderDelegateRegistry) 
context.getRegistry()).getRegistry()).bind("amazonSQSClient", mock);
         SqsComponent component = new SqsComponent(context);
-        SqsEndpoint endpoint = (SqsEndpoint) 
component.createEndpoint("aws-sqs://arn:aws:sqs:region:account:MyQueue?amazonSQSClient=#amazonSQSClient&accessKey=xxx&secretKey=yyy");
+        SqsEndpoint endpoint = (SqsEndpoint) 
component.createEndpoint("aws-sqs://arn:aws:sqs:region:account:MyQueue?amazonSQSClient=#amazonSQSClient&accessKey=xxx&secretKey=yyy&region=US_EAST_2");
 
-        assertEquals("region", endpoint.getConfiguration().getRegion());
 
 Review comment:
   ARN is actually created like “arn:aws:sqs:us-east-2:account:MyQueue”. You 
can try creating a SQS Queue in AWS and check the syntax of ARN. It’s not the 
right place to get Region. Later the value is directly used in com.amazonaws 
API and gives problem in enum. Check the error message I posted in CAMEL-12647. 
Also aws-sns does not have this problem.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Problem in setting region for camel AWS-SQS endpoint
> ----------------------------------------------------
>
>                 Key: CAMEL-12647
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12647
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-aws
>    Affects Versions: 2.21.1
>            Reporter: Saravanakumar Selvaraj
>            Priority: Major
>
> It gives FailedToCreateRouteException while creating camel AWS-SQS endpoint 
> with ARN.
> For example, below producer or consumer endpoint is not being created.
> {code:java}
> uri="aws-sqs://arn:aws:sqs:us-east-2:account:MyQueue?accessKey=xxx&secretKey=yyy&region=US_EAST_2"{code}
> And it throws error as follows.
> {code:java}
> Caused by: java.lang.IllegalArgumentException: No enum constant 
> com.amazonaws.regions.Regions.us-east-2
>       at java.lang.Enum.valueOf(Enum.java:238)
>       at com.amazonaws.regions.Regions.valueOf(Regions.java:26)
>       at 
> org.apache.camel.component.aws.sqs.SqsEndpoint.createClient(SqsEndpoint.java:310)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to