You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2018/12/21 10:42:33 UTC
[camel] 03/03: CAMEL-13013 - Fixed CS and regen
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit ddb30c53e2f378fa7ec92347c99685e394526391
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Dec 21 11:33:13 2018 +0100
CAMEL-13013 - Fixed CS and regen
---
.../camel-aws/src/main/docs/aws-sns-component.adoc | 5 ++-
.../aws/sns/SnsComponentConfigurationTest.java | 8 ++---
.../sns/springboot/SnsComponentConfiguration.java | 38 ++++++++++++++++++++++
3 files changed, 46 insertions(+), 5 deletions(-)
diff --git a/components/camel-aws/src/main/docs/aws-sns-component.adoc b/components/camel-aws/src/main/docs/aws-sns-component.adoc
index 22e6599..8d23273 100644
--- a/components/camel-aws/src/main/docs/aws-sns-component.adoc
+++ b/components/camel-aws/src/main/docs/aws-sns-component.adoc
@@ -67,20 +67,23 @@ with the following path and query parameters:
|===
-==== Query Parameters (11 parameters):
+==== Query Parameters (14 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
| *amazonSNSClient* (producer) | To use the AmazonSNS as the client | | AmazonSNS
+| *amazonSQSClient* (producer) | An SQS Client to use as bridge between SNS and SQS | | AmazonSQS
| *headerFilterStrategy* (producer) | To use a custom HeaderFilterStrategy to map headers to/from Camel. | | HeaderFilterStrategy
| *messageStructure* (producer) | The message structure to use such as json | | String
| *policy* (producer) | The policy for this queue | | String
| *proxyHost* (producer) | To define a proxy host when instantiating the SNS client | | String
| *proxyPort* (producer) | To define a proxy port when instantiating the SNS client | | Integer
+| *queueUrl* (producer) | The queueUrl to subscribe to | | String
| *region* (producer) | The region in which SNS client needs to work | | String
| *subject* (producer) | The subject which is used if the message header 'CamelAwsSnsSubject' is not present. | | String
+| *subscribeSNStoSQS* (producer) | Define if the subscription between SNS Topic and SQS must be done or not | false | boolean
| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
| *accessKey* (security) | Amazon AWS Access Key | | String
| *secretKey* (security) | Amazon AWS Secret Key | | String
diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/sns/SnsComponentConfigurationTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/sns/SnsComponentConfigurationTest.java
index 72b139b..a0b7246 100644
--- a/components/camel-aws/src/test/java/org/apache/camel/component/aws/sns/SnsComponentConfigurationTest.java
+++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/sns/SnsComponentConfigurationTest.java
@@ -122,8 +122,8 @@ public class SnsComponentConfigurationTest extends CamelTestSupport {
((JndiRegistry) ((PropertyPlaceholderDelegateRegistry) context.getRegistry()).getRegistry()).bind("amazonSNSClient", mock);
((JndiRegistry) ((PropertyPlaceholderDelegateRegistry) context.getRegistry()).getRegistry()).bind("amazonSQSClient", mockSQS);
SnsComponent component = new SnsComponent(context);
- SnsEndpoint endpoint = (SnsEndpoint) component.createEndpoint("aws-sns://MyTopic?amazonSNSClient=#amazonSNSClient&" +
- "accessKey=xxx&secretKey=yyy&amazonSQSClient=#amazonSQSClient&queueUrl=arn:aws:sqs:us-east-1:541925086079:MyQueue&subscribeSNStoSQS=true");
+ SnsEndpoint endpoint = (SnsEndpoint) component.createEndpoint("aws-sns://MyTopic?amazonSNSClient=#amazonSNSClient&"
+ + "accessKey=xxx&secretKey=yyy&amazonSQSClient=#amazonSQSClient&queueUrl=arn:aws:sqs:us-east-1:541925086079:MyQueue&subscribeSNStoSQS=true");
assertEquals("MyTopic", endpoint.getConfiguration().getTopicName());
assertEquals("xxx", endpoint.getConfiguration().getAccessKey());
@@ -144,8 +144,8 @@ public class SnsComponentConfigurationTest extends CamelTestSupport {
((JndiRegistry) ((PropertyPlaceholderDelegateRegistry) context.getRegistry()).getRegistry()).bind("amazonSNSClient", mock);
((JndiRegistry) ((PropertyPlaceholderDelegateRegistry) context.getRegistry()).getRegistry()).bind("amazonSQSClient", mockSQS);
SnsComponent component = new SnsComponent(context);
- SnsEndpoint endpoint = (SnsEndpoint) component.createEndpoint("aws-sns://MyTopic?amazonSNSClient=#amazonSNSClient&accessKey=xxx" +
- "&secretKey=yyy&amazonSQSClient=#amazonSQSClient&subscribeSNStoSQS=true");
+ SnsEndpoint endpoint = (SnsEndpoint) component.createEndpoint("aws-sns://MyTopic?amazonSNSClient=#amazonSNSClient&accessKey=xxx"
+ + "&secretKey=yyy&amazonSQSClient=#amazonSQSClient&subscribeSNStoSQS=true");
assertEquals("MyTopic", endpoint.getConfiguration().getTopicName());
assertEquals("xxx", endpoint.getConfiguration().getAccessKey());
diff --git a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sns/springboot/SnsComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sns/springboot/SnsComponentConfiguration.java
index 213404e..bcb7f66 100644
--- a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sns/springboot/SnsComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sns/springboot/SnsComponentConfiguration.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws.sns.springboot;
import javax.annotation.Generated;
import com.amazonaws.services.sns.AmazonSNS;
+import com.amazonaws.services.sqs.AmazonSQS;
import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
import org.springframework.boot.context.properties.ConfigurationProperties;
@@ -150,6 +151,19 @@ public class SnsComponentConfiguration
* The region in which SNS client needs to work
*/
private String region;
+ /**
+ * An SQS Client to use as bridge between SNS and SQS
+ */
+ private AmazonSQS amazonSQSClient;
+ /**
+ * The queueUrl to subscribe to
+ */
+ private String queueUrl;
+ /**
+ * Define if the subscription between SNS Topic and SQS must be done or
+ * not
+ */
+ private Boolean subscribeSNStoSQS = false;
public String getSubject() {
return subject;
@@ -238,5 +252,29 @@ public class SnsComponentConfiguration
public void setRegion(String region) {
this.region = region;
}
+
+ public AmazonSQS getAmazonSQSClient() {
+ return amazonSQSClient;
+ }
+
+ public void setAmazonSQSClient(AmazonSQS amazonSQSClient) {
+ this.amazonSQSClient = amazonSQSClient;
+ }
+
+ public String getQueueUrl() {
+ return queueUrl;
+ }
+
+ public void setQueueUrl(String queueUrl) {
+ this.queueUrl = queueUrl;
+ }
+
+ public Boolean getSubscribeSNStoSQS() {
+ return subscribeSNStoSQS;
+ }
+
+ public void setSubscribeSNStoSQS(Boolean subscribeSNStoSQS) {
+ this.subscribeSNStoSQS = subscribeSNStoSQS;
+ }
}
}
\ No newline at end of file