Added an AWS Translate extension
diff --git a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
index da68234..034c9b1 100644
--- a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
+++ b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
@@ -6,7 +6,7 @@
== Camel Components
// components: START
-Number of Camel components: 55 in 47 JAR artifacts (0 deprecated)
+Number of Camel components: 56 in 48 JAR artifacts (0 deprecated)
[width="100%",cols="4,1,5",options="header"]
|===
@@ -42,6 +42,9 @@
| link:https://camel.apache.org/components/latest/aws-sqs-component.html[AWS Simple Queue Service] (camel-quarkus-aws-sqs) +
`aws-sqs:queueNameOrArn` | 0.2.0 | The aws-sqs component is used for sending and receiving messages to Amazon's SQS service.
+| link:https://camel.apache.org/components/latest/aws-translate-component.html[AWS Translate] (camel-quarkus-aws-translate) +
+`aws-translate:label` | 1.2.0 | The aws-kms is used for managing Amazon Translate
+
| link:https://camel.apache.org/components/latest/bean-component.html[Bean] (camel-quarkus-bean) +
`bean:beanName` | 0.2.0 | The bean component is for invoking Java beans from Camel.
diff --git a/extensions/aws-translate/deployment/pom.xml b/extensions/aws-translate/deployment/pom.xml
new file mode 100644
index 0000000..f2e49a1
--- /dev/null
+++ b/extensions/aws-translate/deployment/pom.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-aws-translate-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-aws-translate-deployment</artifactId>
+ <name>Camel Quarkus :: AWS Translate :: Deployment</name>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bom-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-core-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-support-xml-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-support-commons-logging-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-support-aws-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-aws-translate</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <annotationProcessorPaths>
+ <path>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-extension-processor</artifactId>
+ <version>${quarkus.version}</version>
+ </path>
+ </annotationProcessorPaths>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/extensions/aws-translate/deployment/src/main/java/org/apache/camel/quarkus/component/aws/translate/deployment/AwsTranslateProcessor.java b/extensions/aws-translate/deployment/src/main/java/org/apache/camel/quarkus/component/aws/translate/deployment/AwsTranslateProcessor.java
new file mode 100644
index 0000000..3bb313b
--- /dev/null
+++ b/extensions/aws-translate/deployment/src/main/java/org/apache/camel/quarkus/component/aws/translate/deployment/AwsTranslateProcessor.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.aws.translate.deployment;
+
+import org.apache.camel.component.aws.translate.TranslateConfiguration;
+
+import com.amazonaws.auth.AWS4Signer;
+import com.amazonaws.partitions.model.CredentialScope;
+import com.amazonaws.partitions.model.Endpoint;
+import com.amazonaws.partitions.model.Partition;
+import com.amazonaws.partitions.model.Partitions;
+import com.amazonaws.partitions.model.Region;
+import com.amazonaws.partitions.model.Service;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+
+class AwsTranslateProcessor {
+
+ public static final String AWS_TRANSLATE_APPLICATION_ARCHIVE_MARKERS = "com/amazonaws";
+
+ private static final String FEATURE = "camel-aws-translate";
+
+ @BuildStep
+ FeatureBuildItem feature() {
+ return new FeatureBuildItem(FEATURE);
+ }
+
+ @BuildStep
+ ExtensionSslNativeSupportBuildItem activateSslNativeSupport() {
+ return new ExtensionSslNativeSupportBuildItem(FEATURE);
+ }
+
+ @BuildStep(applicationArchiveMarkers = { AWS_TRANSLATE_APPLICATION_ARCHIVE_MARKERS })
+ void process(CombinedIndexBuildItem combinedIndexBuildItem,
+ BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
+ BuildProducer<NativeImageResourceBuildItem> resource) {
+
+ resource.produce(new NativeImageResourceBuildItem("com/amazonaws/partitions/endpoints.json"));
+ reflectiveClass.produce(new ReflectiveClassBuildItem(true, false,
+ Partitions.class.getCanonicalName(),
+ Partition.class.getCanonicalName(),
+ Endpoint.class.getCanonicalName(),
+ Region.class.getCanonicalName(),
+ Service.class.getCanonicalName(),
+ CredentialScope.class.getCanonicalName(),
+ AWS4Signer.class.getCanonicalName(),
+ TranslateConfiguration.class.getCanonicalName()));
+ }
+}
diff --git a/extensions/aws-translate/pom.xml b/extensions/aws-translate/pom.xml
new file mode 100644
index 0000000..1a3c0a5
--- /dev/null
+++ b/extensions/aws-translate/pom.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-build-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../../poms/build-parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-aws-translate-parent</artifactId>
+ <name>Camel Quarkus :: AWS Translate</name>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>deployment</module>
+ <module>runtime</module>
+ </modules>
+</project>
diff --git a/extensions/aws-translate/runtime/pom.xml b/extensions/aws-translate/runtime/pom.xml
new file mode 100644
index 0000000..21a5ed4
--- /dev/null
+++ b/extensions/aws-translate/runtime/pom.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-aws-translate-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-aws-translate</artifactId>
+ <name>Camel Quarkus :: AWS Translate :: Runtime</name>
+
+ <properties>
+ <firstVersion>1.2.0</firstVersion>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bom</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-support-xml</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-support-commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-support-aws</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-aws-translate</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
+ <artifactId>jackson-dataformat-cbor</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-bootstrap-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <annotationProcessorPaths>
+ <path>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-extension-processor</artifactId>
+ <version>${quarkus.version}</version>
+ </path>
+ </annotationProcessorPaths>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/extensions/aws-translate/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/aws-translate/runtime/src/main/resources/META-INF/quarkus-extension.yaml
new file mode 100644
index 0000000..a6f1cee
--- /dev/null
+++ b/extensions/aws-translate/runtime/src/main/resources/META-INF/quarkus-extension.yaml
@@ -0,0 +1,28 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+---
+name: "Camel Quarkus AWS Translate"
+description: "A Camel Amazon Translate Web Service Component"
+metadata:
+ keywords:
+ - "camel"
+ - "aws"
+ - "cloud"
+ guide: "https://quarkus.io/guides/camel"
+ categories:
+ - "integration"
diff --git a/extensions/pom.xml b/extensions/pom.xml
index b6a731c..4e5d44b 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -54,6 +54,7 @@
<module>aws-s3</module>
<module>aws-sns</module>
<module>aws-sqs</module>
+ <module>aws-translate</module>
<module>base64</module>
<module>bean</module>
<module>bean-validator</module>
diff --git a/extensions/readme.adoc b/extensions/readme.adoc
index e611b8d..b255b72 100644
--- a/extensions/readme.adoc
+++ b/extensions/readme.adoc
@@ -5,7 +5,7 @@
== Camel Components
// components: START
-Number of Camel components: 55 in 47 JAR artifacts (0 deprecated)
+Number of Camel components: 56 in 48 JAR artifacts (0 deprecated)
[width="100%",cols="4,1,5",options="header"]
|===
@@ -41,6 +41,9 @@
| link:https://camel.apache.org/components/latest/aws-sqs-component.html[AWS Simple Queue Service] (camel-quarkus-aws-sqs) +
`aws-sqs:queueNameOrArn` | 0.2.0 | The aws-sqs component is used for sending and receiving messages to Amazon's SQS service.
+| link:https://camel.apache.org/components/latest/aws-translate-component.html[AWS Translate] (camel-quarkus-aws-translate) +
+`aws-translate:label` | 1.2.0 | The aws-kms is used for managing Amazon Translate
+
| link:https://camel.apache.org/components/latest/bean-component.html[Bean] (camel-quarkus-bean) +
`bean:beanName` | 0.2.0 | The bean component is for invoking Java beans from Camel.
diff --git a/integration-tests/aws/pom.xml b/integration-tests/aws/pom.xml
index ba57aee..f58b256 100644
--- a/integration-tests/aws/pom.xml
+++ b/integration-tests/aws/pom.xml
@@ -68,6 +68,10 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-aws-translate</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-log</artifactId>
</dependency>
<dependency>
diff --git a/integration-tests/aws/src/main/java/org/apache/camel/quarkus/component/aws/CamelRoute.java b/integration-tests/aws/src/main/java/org/apache/camel/quarkus/component/aws/CamelRoute.java
index 5efbabf..0fe5403 100644
--- a/integration-tests/aws/src/main/java/org/apache/camel/quarkus/component/aws/CamelRoute.java
+++ b/integration-tests/aws/src/main/java/org/apache/camel/quarkus/component/aws/CamelRoute.java
@@ -18,6 +18,8 @@
import io.quarkus.runtime.annotations.RegisterForReflection;
import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.aws.translate.TranslateConstants;
+import org.apache.camel.component.aws.translate.TranslateLanguageEnum;
@RegisterForReflection
public class CamelRoute extends RouteBuilder {
@@ -65,6 +67,13 @@
from("timer:quarkus-lambda?repeatCount=1")
.to("aws-lambda://cluster?operation=listFunctions")
.to("log:sf?showAll=true");
+
+ from("timer:quarkus-translate?repeatCount=1")
+ .setHeader(TranslateConstants.SOURCE_LANGUAGE, constant(TranslateLanguageEnum.ITALIAN))
+ .setHeader(TranslateConstants.TARGET_LANGUAGE, constant(TranslateLanguageEnum.GERMAN))
+ .setBody(constant("Ciao"))
+ .to("aws-translate://cluster?operation=translateText")
+ .log("Translation: ${body}");
}
}
diff --git a/integration-tests/aws/src/main/resources/application.properties b/integration-tests/aws/src/main/resources/application.properties
index 5ab71a5..2b5441c 100644
--- a/integration-tests/aws/src/main/resources/application.properties
+++ b/integration-tests/aws/src/main/resources/application.properties
@@ -86,4 +86,11 @@
#
camel.component.aws-lambda.access-key={{env:AWS_ACCESS_KEY}}
camel.component.aws-lambda.secret-key={{env:AWS_SECRET_KEY}}
-camel.component.aws-lambda.region={{env:AWS_REGION}}
\ No newline at end of file
+camel.component.aws-lambda.region={{env:AWS_REGION}}
+
+#
+# Camel :: AWS Translate
+#
+camel.component.aws-translate.access-key={{env:AWS_ACCESS_KEY}}
+camel.component.aws-translate.secret-key={{env:AWS_SECRET_KEY}}
+camel.component.aws-translate.region={{env:AWS_REGION}}
\ No newline at end of file
diff --git a/poms/bom-deployment/pom.xml b/poms/bom-deployment/pom.xml
index 5cb40a7..6418d9b 100644
--- a/poms/bom-deployment/pom.xml
+++ b/poms/bom-deployment/pom.xml
@@ -116,6 +116,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-aws-translate-deployment</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-base64-deployment</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>
diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml
index 0c61fcb..11aa045 100644
--- a/poms/bom/pom.xml
+++ b/poms/bom/pom.xml
@@ -123,6 +123,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-aws-translate</artifactId>
+ <version>${camel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-base</artifactId>
<version>${camel.version}</version>
</dependency>
@@ -535,6 +540,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-aws-translate</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-base64</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>