camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1342144 - in /camel/branches/camel-2.9.x: ./ components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/ components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/
Date Thu, 24 May 2012 04:52:54 GMT
Author: davsclaus
Date: Thu May 24 04:52:53 2012
New Revision: 1342144

URL: http://svn.apache.org/viewvc?rev=1342144&view=rev
Log:
CAMEL-5298: Added delaySeconds option to aws-sqs. Thanks to Alex Hutter for the patch.

Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java
    camel/branches/camel-2.9.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java
    camel/branches/camel-2.9.x/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1342143

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.9.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java?rev=1342144&r1=1342143&r2=1342144&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java
Thu May 24 04:52:53 2012
@@ -39,6 +39,9 @@ public class SqsConfiguration {
     private Collection<String> attributeNames;
     private Integer defaultVisibilityTimeout;
     
+    // producer properties
+    private Integer delaySeconds;
+    
     // queue properties
     private Integer maximumMessageSize;
     private Integer messageRetentionPeriod;
@@ -116,6 +119,14 @@ public class SqsConfiguration {
         this.defaultVisibilityTimeout = defaultVisibilityTimeout;
     }
 
+    public Integer getDelaySeconds() {
+        return delaySeconds;
+    }
+
+    public void setDelaySeconds(Integer delaySeconds) {
+        this.delaySeconds = delaySeconds;
+    }
+
     public Integer getMaximumMessageSize() {
         return maximumMessageSize;
     }
@@ -152,6 +163,7 @@ public class SqsConfiguration {
             + ", defaultVisibilityTimeout=" + defaultVisibilityTimeout
             + ", maximumMessageSize=" + maximumMessageSize
             + ", messageRetentionPeriod=" + messageRetentionPeriod
+            + ", delaySeconds=" + delaySeconds
             + ", policy=" + policy
             + "]";
     }

Modified: camel/branches/camel-2.9.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java?rev=1342144&r1=1342143&r2=1342144&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java
Thu May 24 04:52:53 2012
@@ -44,6 +44,7 @@ public class SqsProducer extends Default
     public void process(Exchange exchange) throws Exception {
         String body = exchange.getIn().getBody(String.class);
         SendMessageRequest request = new SendMessageRequest(getQueueUrl(), body);
+        request.setDelaySeconds(getEndpoint().getConfiguration().getDelaySeconds());
 
         LOG.trace("Sending request [{}] from exchange [{}]...", request, exchange);
         

Modified: camel/branches/camel-2.9.x/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java?rev=1342144&r1=1342143&r2=1342144&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java
Thu May 24 04:52:53 2012
@@ -78,7 +78,8 @@ public class SqsComponentConfigurationTe
         SqsEndpoint endpoint = (SqsEndpoint) component.createEndpoint("aws-sqs://MyQueue?amazonSQSEndpoint=sns.eu-west-1.amazonaws.com&accessKey=xxx&secretKey=yyy&attributeNames=#attributeNames"
                 + "&DefaultVisibilityTimeout=1000&visibilityTimeout=2000&maximumMessageSize=65536&messageRetentionPeriod=1209600&policy="
                 + "%7B%22Version%22%3A%222008-10-17%22%2C%22Id%22%3A%22%2F195004372649%2FMyQueue%2FSQSDefaultPolicy%22%2C%22Statement%22%3A%5B%7B%22Sid%22%3A%22Queue1ReceiveMessage%22%2C%22"
-                + "Effect%22%3A%22Allow%22%2C%22Principal%22%3A%7B%22AWS%22%3A%22*%22%7D%2C%22Action%22%3A%22SQS%3AReceiveMessage%22%2C%22Resource%22%3A%22%2F195004372649%2FMyQueue%22%7D%5D%7D");
+                + "Effect%22%3A%22Allow%22%2C%22Principal%22%3A%7B%22AWS%22%3A%22*%22%7D%2C%22Action%22%3A%22SQS%3AReceiveMessage%22%2C%22Resource%22%3A%22%2F195004372649%2FMyQueue%22%7D%5D%7D"
+                + "&delaySeconds=123");
         
         assertEquals("MyQueue", endpoint.getConfiguration().getQueueName());
         assertEquals("xxx", endpoint.getConfiguration().getAccessKey());
@@ -93,6 +94,7 @@ public class SqsComponentConfigurationTe
         assertEquals("{\"Version\":\"2008-10-17\",\"Id\":\"/195004372649/MyQueue/SQSDefaultPolicy\",\"Statement\":[{\"Sid\":\"Queue1ReceiveMessage\",\"Effect\":\"Allow\",\"Principal\":"
                 + "{\"AWS\":\"*\"},\"Action\":\"SQS:ReceiveMessage\",\"Resource\":\"/195004372649/MyQueue\"}]}",
                 endpoint.getConfiguration().getPolicy());
+        assertEquals(new Integer(123), endpoint.getConfiguration().getDelaySeconds());
     }
     
     @Test



Mime
View raw message