camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bibr...@apache.org
Subject svn commit: r1447190 - in /camel/branches/camel-2.10.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/ components/camel-aws/src/test/resources/org/apache/...
Date Mon, 18 Feb 2013 11:07:35 GMT
Author: bibryam
Date: Mon Feb 18 11:07:34 2013
New Revision: 1447190

URL: http://svn.apache.org/r1447190
Log:
Merged revisions 1410099 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r1410099 | bibryam | 2012-11-15 23:09:11 +0000 (Thu, 15 Nov 2012) | 2 lines
  
  Update aws library to 1.3.25
  Introduced two new options for SQS consumer to enable long polling: waitTimeSeconds and
receiveMessageWaitTimeSeconds
........

Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java
    camel/branches/camel-2.10.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConsumer.java
    camel/branches/camel-2.10.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java
    camel/branches/camel-2.10.x/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java
    camel/branches/camel-2.10.x/components/camel-aws/src/test/resources/org/apache/camel/component/aws/sqs/SqsComponentSpringTest-context.xml
    camel/branches/camel-2.10.x/components/camel-jms/   (props changed)
    camel/branches/camel-2.10.x/parent/pom.xml

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1410099

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

Modified: camel/branches/camel-2.10.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.10.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java?rev=1447190&r1=1447189&r2=1447190&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java
(original)
+++ camel/branches/camel-2.10.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java
Mon Feb 18 11:07:34 2013
@@ -37,6 +37,7 @@ public class SqsConfiguration {
     private Boolean deleteAfterRead = Boolean.TRUE;
     private Integer visibilityTimeout;
     private Collection<String> attributeNames;
+    private Integer waitTimeSeconds;
     private Integer defaultVisibilityTimeout;
     private Boolean extendMessageVisibility = Boolean.FALSE;
     
@@ -46,6 +47,7 @@ public class SqsConfiguration {
     // queue properties
     private Integer maximumMessageSize;
     private Integer messageRetentionPeriod;
+    private Integer receiveMessageWaitTimeSeconds;
     private String policy;
     
     public void setAmazonSQSEndpoint(String amazonSQSEndpoint) {
@@ -160,6 +162,22 @@ public class SqsConfiguration {
         this.extendMessageVisibility = extendMessageVisibility;
     }
 
+    public Integer getReceiveMessageWaitTimeSeconds() {
+        return receiveMessageWaitTimeSeconds;
+    }
+
+    public void setReceiveMessageWaitTimeSeconds(Integer receiveMessageWaitTimeSeconds) {
+        this.receiveMessageWaitTimeSeconds = receiveMessageWaitTimeSeconds;
+    }
+
+    public Integer getWaitTimeSeconds() {
+        return waitTimeSeconds;
+    }
+
+    public void setWaitTimeSeconds(Integer waitTimeSeconds) {
+        this.waitTimeSeconds = waitTimeSeconds;
+    }
+
     @Override
     public String toString() {
         return "SqsConfiguration[queueName=" + queueName
@@ -169,9 +187,11 @@ public class SqsConfiguration {
             + ", deleteAfterRead=" + deleteAfterRead
             + ", visibilityTimeout=" + visibilityTimeout
             + ", attributeNames=" + attributeNames
+            + ", waitTimeSeconds=" + waitTimeSeconds
             + ", defaultVisibilityTimeout=" + defaultVisibilityTimeout
             + ", maximumMessageSize=" + maximumMessageSize
             + ", messageRetentionPeriod=" + messageRetentionPeriod
+            + ", receiveMessageWaitTimeSeconds=" + receiveMessageWaitTimeSeconds
             + ", delaySeconds=" + delaySeconds
             + ", policy=" + policy
             + ", extendMessageVisibility=" + extendMessageVisibility

Modified: camel/branches/camel-2.10.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConsumer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConsumer.java?rev=1447190&r1=1447189&r2=1447190&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConsumer.java
(original)
+++ camel/branches/camel-2.10.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConsumer.java
Mon Feb 18 11:07:34 2013
@@ -69,7 +69,8 @@ public class SqsConsumer extends Schedul
         request.setMaxNumberOfMessages(getMaxMessagesPerPoll() > 0 ? getMaxMessagesPerPoll()
: null);
         request.setVisibilityTimeout(getConfiguration().getVisibilityTimeout() != null ?
getConfiguration().getVisibilityTimeout() : null);
         request.setAttributeNames(getConfiguration().getAttributeNames() != null ? getConfiguration().getAttributeNames()
: null);
-        
+        request.setWaitTimeSeconds(getConfiguration().getWaitTimeSeconds() != null ? getConfiguration().getWaitTimeSeconds()
: null);
+
         LOG.trace("Receiving messages with request [{}]...", request);
         
         ReceiveMessageResult messageResult = getClient().receiveMessage(request);

Modified: camel/branches/camel-2.10.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java?rev=1447190&r1=1447189&r2=1447190&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java
(original)
+++ camel/branches/camel-2.10.x/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java
Mon Feb 18 11:07:34 2013
@@ -110,7 +110,10 @@ public class SqsEndpoint extends Schedul
         }
         if (getConfiguration().getPolicy() != null) {
             request.getAttributes().put(QueueAttributeName.Policy.name(), String.valueOf(getConfiguration().getPolicy()));
-        }        
+        }
+        if (getConfiguration().getReceiveMessageWaitTimeSeconds() != null) {
+            request.getAttributes().put(QueueAttributeName.ReceiveMessageWaitTimeSeconds.name(),
String.valueOf(getConfiguration().getReceiveMessageWaitTimeSeconds()));
+        }
         LOG.trace("Creating queue [{}] with request [{}]...", configuration.getQueueName(),
request);
         
         CreateQueueResult queueResult = client.createQueue(request);
@@ -134,7 +137,9 @@ public class SqsEndpoint extends Schedul
         if (getConfiguration().getPolicy() != null) {
             request.getAttributes().put(QueueAttributeName.Policy.name(), String.valueOf(getConfiguration().getPolicy()));
         }
-        
+        if (getConfiguration().getReceiveMessageWaitTimeSeconds() != null) {
+            request.getAttributes().put(QueueAttributeName.ReceiveMessageWaitTimeSeconds.name(),
String.valueOf(getConfiguration().getReceiveMessageWaitTimeSeconds()));
+        }
         if (!request.getAttributes().isEmpty()) {
             LOG.trace("Updating queue '{}' with the provided queue attributes...", configuration.getQueueName());
             client.setQueueAttributes(request);

Modified: camel/branches/camel-2.10.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.10.x/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java?rev=1447190&r1=1447189&r2=1447190&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java
(original)
+++ camel/branches/camel-2.10.x/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java
Mon Feb 18 11:07:34 2013
@@ -79,7 +79,7 @@ public class SqsComponentConfigurationTe
                 + "&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"
-                + "&delaySeconds=123");
+                + "&delaySeconds=123&receiveMessageWaitTimeSeconds=10&waitTimeSeconds=20");
         
         assertEquals("MyQueue", endpoint.getConfiguration().getQueueName());
         assertEquals("xxx", endpoint.getConfiguration().getAccessKey());
@@ -95,6 +95,8 @@ public class SqsComponentConfigurationTe
                 + "{\"AWS\":\"*\"},\"Action\":\"SQS:ReceiveMessage\",\"Resource\":\"/195004372649/MyQueue\"}]}",
                 endpoint.getConfiguration().getPolicy());
         assertEquals(new Integer(123), endpoint.getConfiguration().getDelaySeconds());
+        assertEquals(Integer.valueOf(10), endpoint.getConfiguration().getReceiveMessageWaitTimeSeconds());
+        assertEquals(Integer.valueOf(20), endpoint.getConfiguration().getWaitTimeSeconds());
     }
     
     @Test

Modified: camel/branches/camel-2.10.x/components/camel-aws/src/test/resources/org/apache/camel/component/aws/sqs/SqsComponentSpringTest-context.xml
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-aws/src/test/resources/org/apache/camel/component/aws/sqs/SqsComponentSpringTest-context.xml?rev=1447190&r1=1447189&r2=1447190&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-aws/src/test/resources/org/apache/camel/component/aws/sqs/SqsComponentSpringTest-context.xml
(original)
+++ camel/branches/camel-2.10.x/components/camel-aws/src/test/resources/org/apache/camel/component/aws/sqs/SqsComponentSpringTest-context.xml
Mon Feb 18 11:07:34 2013
@@ -23,11 +23,11 @@
     <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
         <route>
             <from uri="direct:start"/>
-            <to uri="aws-sqs://MyQueue?amazonSQSClient=#amazonSQSClient&amp;messageRetentionPeriod=1209600&amp;maximumMessageSize=65536&amp;policy="/>
+            <to uri="aws-sqs://MyQueue?amazonSQSClient=#amazonSQSClient&amp;messageRetentionPeriod=1209600&amp;maximumMessageSize=65536&amp;receiveMessageWaitTimeSeconds=20&amp;policy="/>
         </route>
 
         <route>
-            <from uri="aws-sqs://MyQueue?amazonSQSClient=#amazonSQSClient&amp;messageRetentionPeriod=1209600&amp;maximumMessageSize=65536&amp;policy="/>
+            <from uri="aws-sqs://MyQueue?amazonSQSClient=#amazonSQSClient&amp;messageRetentionPeriod=1209600&amp;maximumMessageSize=65536&amp;receiveMessageWaitTimeSeconds=20&amp;policy="/>
             <to uri="mock:result"/>
         </route>
     </camelContext>

Propchange: camel/branches/camel-2.10.x/components/camel-jms/
------------------------------------------------------------------------------
  Merged /camel/trunk/components/camel-jms:r1410099

Modified: camel/branches/camel-2.10.x/parent/pom.xml
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/parent/pom.xml?rev=1447190&r1=1447189&r2=1447190&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/parent/pom.xml (original)
+++ camel/branches/camel-2.10.x/parent/pom.xml Mon Feb 18 11:07:34 2013
@@ -46,7 +46,7 @@
     <avro-version>1.6.2</avro-version>
     <avro-bundle-version>1.6.1_1</avro-bundle-version>
     <aws-java-sdk-bundle-version>1.3.14_1</aws-java-sdk-bundle-version>
-    <aws-java-sdk-version>1.3.14</aws-java-sdk-version>
+    <aws-java-sdk-version>1.3.25</aws-java-sdk-version>
     <axiom-version>1.2.14</axiom-version>
     <beanio-version>2.0.2</beanio-version>
     <bouncycastle-version>1.46</bouncycastle-version>



Mime
View raw message