camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rufus.Nash" <rufus.n...@ocado.com>
Subject AWS-SQS - Policy issues - Defining the deadLetterTargetArn in the same way as the SqsEndpoint
Date Fri, 28 Nov 2014 16:59:55 GMT
Hi 
I'm having an issue with deadLetterTargetArn in the AWS-SQS Policy of a
Camel SqsEndPoint when I don't necessarily know my region or
QueueOwnerAWSAccountId.
I was hoping that there was a way to define the arn in the Policy in the
same way as the SqsEndpoint is defines SQS queues. 
 For the sake of completeness the below excerpt is the way Camel 
SqsEndpoint handles endpoints.
91
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#91>
  
*if* ( configuration
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#SqsEndpoint.0configuration>

. getRegion
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsConfiguration.java#SqsConfiguration.getRegion%28%29>

() != *null* &amp;&amp;  configuration
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#SqsEndpoint.0configuration>

. getQueueOwnerAWSAccountId
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsConfiguration.java#SqsConfiguration.getQueueOwnerAWSAccountId%28%29>

() != *null*) {
92
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#92>
       
queueUrl
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#SqsEndpoint.0queueUrl>
 
= "https://sqs." +  configuration
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#SqsEndpoint.0configuration>

. getRegion
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsConfiguration.java#SqsConfiguration.getRegion%28%29>

() + ".amazonaws.com/"
93
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#93>
          
+   configuration
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#SqsEndpoint.0configuration>

. getQueueOwnerAWSAccountId
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsConfiguration.java#SqsConfiguration.getQueueOwnerAWSAccountId%28%29>

() + "/" +  configuration
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#SqsEndpoint.0configuration>

. getQueueName
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsConfiguration.java#SqsConfiguration.getQueueName%28%29>

();
94
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#94>
  
} *else* *if* ( configuration
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#SqsEndpoint.0configuration>

. getQueueOwnerAWSAccountId
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsConfiguration.java#SqsConfiguration.getQueueOwnerAWSAccountId%28%29>

() != *null*) {
95
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#95>
       
GetQueueUrlRequest
<http://grepcode.com/file/repo1.maven.org/maven2/com.amazonaws/aws-java-sdk/1.7.12/com/amazonaws/services/sqs/model/GetQueueUrlRequest.java#GetQueueUrlRequest>
 
getQueueUrlRequest = *new*  GetQueueUrlRequest
<http://grepcode.com/file/repo1.maven.org/maven2/com.amazonaws/aws-java-sdk/1.7.12/com/amazonaws/services/sqs/model/GetQueueUrlRequest.java#GetQueueUrlRequest>

();
96
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#96>
      
getQueueUrlRequest. setQueueName
<http://grepcode.com/file/repo1.maven.org/maven2/com.amazonaws/aws-java-sdk/1.7.12/com/amazonaws/services/sqs/model/GetQueueUrlRequest.java#GetQueueUrlRequest.setQueueName%28java.lang.String%29>

( configuration
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#SqsEndpoint.0configuration>

. getQueueName
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsConfiguration.java#SqsConfiguration.getQueueName%28%29>

());
97
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#97>
      
getQueueUrlRequest. setQueueOwnerAWSAccountId
<http://grepcode.com/file/repo1.maven.org/maven2/com.amazonaws/aws-java-sdk/1.7.12/com/amazonaws/services/sqs/model/GetQueueUrlRequest.java#GetQueueUrlRequest.setQueueOwnerAWSAccountId%28java.lang.String%29>

( configuration
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#SqsEndpoint.0configuration>

. getQueueOwnerAWSAccountId
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsConfiguration.java#SqsConfiguration.getQueueOwnerAWSAccountId%28%29>

());
98
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#98>
       
GetQueueUrlResult
<http://grepcode.com/file/repo1.maven.org/maven2/com.amazonaws/aws-java-sdk/1.7.12/com/amazonaws/services/sqs/model/GetQueueUrlResult.java#GetQueueUrlResult>
 
getQueueUrlResult =  client
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#SqsEndpoint.0client>

. getQueueUrl
<http://grepcode.com/file/repo1.maven.org/maven2/com.amazonaws/aws-java-sdk/1.7.12/com/amazonaws/services/sqs/AmazonSQS.java#AmazonSQS.getQueueUrl%28com.amazonaws.services.sqs.model.GetQueueUrlRequest%29>

(getQueueUrlRequest);
99
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#99>
       
queueUrl
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#SqsEndpoint.0queueUrl>
 
= getQueueUrlResult. getQueueUrl
<http://grepcode.com/file/repo1.maven.org/maven2/com.amazonaws/aws-java-sdk/1.7.12/com/amazonaws/services/sqs/model/GetQueueUrlResult.java#GetQueueUrlResult.getQueueUrl%28%29>

();
100
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#100>
  
} *else* {
101
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#101>
      
// check whether the queue already exists
102
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#102>
       
ListQueuesResult
<http://grepcode.com/file/repo1.maven.org/maven2/com.amazonaws/aws-java-sdk/1.7.12/com/amazonaws/services/sqs/model/ListQueuesResult.java#ListQueuesResult>
 
listQueuesResult =  client
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#SqsEndpoint.0client>

. listQueues
<http://grepcode.com/file/repo1.maven.org/maven2/com.amazonaws/aws-java-sdk/1.7.12/com/amazonaws/services/sqs/AmazonSQS.java#AmazonSQS.listQueues%28%29>

();
103
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#103>
      
*for* ( String
<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/java/lang/String.java#String>
 
url : listQueuesResult. getQueueUrls
<http://grepcode.com/file/repo1.maven.org/maven2/com.amazonaws/aws-java-sdk/1.7.12/com/amazonaws/services/sqs/model/ListQueuesResult.java#ListQueuesResult.getQueueUrls%28%29>

()) {
104
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#104>
          
*if* (url. endsWith
<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/java/lang/String.java#String.endsWith%28java.lang.String%29>

("/" +  configuration
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#SqsEndpoint.0configuration>

. getQueueName
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsConfiguration.java#SqsConfiguration.getQueueName%28%29>

())) {
105
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#105>
               
queueUrl
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#SqsEndpoint.0queueUrl>
 
= url;
106
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#106>
               
LOG
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#SqsEndpoint.0LOG>

. trace
<http://grepcode.com/file/repo1.maven.org/maven2/org.slf4j/slf4j-api/1.7.7/org/slf4j/Logger.java#Logger.trace%28java.lang.String%2Cjava.lang.Object%29>

("Queue available at '{}'.",  queueUrl
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#SqsEndpoint.0queueUrl>

);
107
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#107>
              
*break*;
108
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#108>
          
}
109
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#109>
      
}
110
<http://grepcode.com/file/repo1.maven.org/maven2/org.apache.camel/camel-aws/2.13.2/org/apache/camel/component/aws/sqs/SqsEndpoint.java#110>
  
}
If people have any input on the best way to handle this, it'd be greatly
appreciated.



--
View this message in context: http://camel.465427.n5.nabble.com/AWS-SQS-Policy-issues-Defining-the-deadLetterTargetArn-in-the-same-way-as-the-SqsEndpoint-tp5759773.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message