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 e16e7af01b3ab01708d1130f321bb48ecc581af5
Author: Andrea Cosentino <[email protected]>
AuthorDate: Wed Jan 15 12:24:20 2020 +0100

    CAMEL-13784 - Update to AWS SDK V2 - Created camel-aws2-translate
---
 apache-camel/pom.xml                               |   5 +
 apache-camel/src/main/descriptors/common-bin.xml   |   1 +
 components/camel-aws2-translate/pom.xml            |  86 +++++++++
 .../src/main/docs/aws2-translate-component.adoc    | 164 +++++++++++++++++
 .../aws2/translate/TranslateComponent.java         | 123 +++++++++++++
 .../TranslateComponentVerifierExtension.java       |  87 ++++++++++
 .../aws2/translate/TranslateConfiguration.java     | 193 +++++++++++++++++++++
 .../aws2/translate/TranslateConstants.java         |  27 +++
 .../aws2/translate/TranslateEndpoint.java          | 122 +++++++++++++
 .../aws2/translate/TranslateLanguageEnum.java      |  36 ++++
 .../aws2/translate/TranslateOperations.java        |  22 +++
 .../aws2/translate/TranslateProducer.java          | 130 ++++++++++++++
 .../aws2/translate/AmazonAWSTranslateMock.java     |  42 +++++
 .../translate/TranslateProducerSpringTest.java     |  60 +++++++
 .../aws2/translate/TranslateProducerTest.java      |  87 ++++++++++
 .../TranslateProducerIntegrationTest.java          |  87 ++++++++++
 .../src/test/resources/log4j2.properties           |  28 +++
 .../TranslateComponentSpringTest-context.xml       |  35 ++++
 .../dsl/TranslateEndpointBuilderFactory.java       |  36 ++--
 parent/pom.xml                                     |   1 +
 20 files changed, 1354 insertions(+), 18 deletions(-)

diff --git a/apache-camel/pom.xml b/apache-camel/pom.xml
index fa0d4e1..8789a03 100644
--- a/apache-camel/pom.xml
+++ b/apache-camel/pom.xml
@@ -288,6 +288,11 @@
     </dependency>
     <dependency>
       <groupId>org.apache.camel</groupId>
+      <artifactId>camel-aws2-translate</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
       <artifactId>camel-azure</artifactId>
       <version>${project.version}</version>
     </dependency>
diff --git a/apache-camel/src/main/descriptors/common-bin.xml 
b/apache-camel/src/main/descriptors/common-bin.xml
index 533bdb5..34b676be 100644
--- a/apache-camel/src/main/descriptors/common-bin.xml
+++ b/apache-camel/src/main/descriptors/common-bin.xml
@@ -78,6 +78,7 @@
         <include>org.apache.camel:camel-aws-swf</include>
         <include>org.apache.camel:camel-aws-translate</include>
         <include>org.apache.camel:camel-aws-xray</include>
+        <include>org.apache.camel:camel-aws2-translate</include>
         <include>org.apache.camel:camel-azure</include>
         <include>org.apache.camel:camel-barcode</include>
         <include>org.apache.camel:camel-base64</include>
diff --git a/components/camel-aws2-translate/pom.xml 
b/components/camel-aws2-translate/pom.xml
new file mode 100644
index 0000000..ad5a274
--- /dev/null
+++ b/components/camel-aws2-translate/pom.xml
@@ -0,0 +1,86 @@
+<?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/maven-v4_0_0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>components</artifactId>
+        <version>3.1.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-aws2-translate</artifactId>
+    <packaging>jar</packaging>
+
+    <name>Camel :: AWS2 Translate</name>
+    <description>A Camel Amazon Translate Web Service Component Version 
2</description>
+
+    <properties>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-support</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>software.amazon.awssdk</groupId>
+            <artifactId>translate</artifactId>
+            <version>${aws-java-sdk2-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>software.amazon.awssdk</groupId>
+            <artifactId>apache-client</artifactId>
+            <version>${aws-java-sdk2-version}</version>
+        </dependency>
+
+        <!-- for testing -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-test-spring</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-slf4j-impl</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>
diff --git 
a/components/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc 
b/components/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc
new file mode 100644
index 0000000..dff0724
--- /dev/null
+++ 
b/components/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc
@@ -0,0 +1,164 @@
+[[aws2-translate-component]]
+= AWS Translate Component
+
+*Since Camel 3.1*
+
+*Since Camel 3.1*
+
+
+// HEADER START
+*Only producer is supported*
+// HEADER END
+
+The Translate component supports translate a text in multiple languages.
+https://aws.amazon.com/translate/[AWS Translate] clusters instances.
+
+Prerequisites
+
+You must have a valid Amazon Web Services developer account, and be
+signed up to use Amazon Translate. More information is available at
+https://aws.amazon.com/translate/[Amazon Translate].
+
+== URI Format
+
+[source,java]
+-------------------------
+aws-translate://label[?options]
+-------------------------
+
+You can append query options to the URI in the following format,
+?options=value&option2=value&...
+
+== URI Options
+
+
+// component options: START
+The AWS Translate component supports 6 options, which are listed below.
+
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *configuration* (advanced) | The AWS Translate default configuration |  | 
TranslateConfiguration
+| *accessKey* (producer) | Amazon AWS Access Key |  | String
+| *secretKey* (producer) | Amazon AWS Secret Key |  | String
+| *region* (producer) | The region in which Translate client needs to work |  
| String
+| *basicPropertyBinding* (advanced) | Whether the component should use basic 
property binding (Camel 2.x) or the newer property binding with additional 
capabilities | false | boolean
+| *lazyStartProducer* (producer) | Whether the producer should be started lazy 
(on the first message). By starting lazy you can use this to allow CamelContext 
and routes to startup in situations where a producer may otherwise fail during 
starting and cause the route to fail being started. By deferring this startup 
to be lazy then the startup failure can be handled during routing messages via 
Camel's routing error handlers. Beware that when the first message is processed 
then creating and [...]
+|===
+// component options: END
+
+
+
+
+// endpoint options: START
+The AWS Translate endpoint is configured using URI syntax:
+
+----
+aws2-translate:label
+----
+
+with the following path and query parameters:
+
+=== Path Parameters (1 parameters):
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *label* | *Required* Logical name |  | String
+|===
+
+
+=== Query Parameters (14 parameters):
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *accessKey* (producer) | Amazon AWS Access Key |  | String
+| *autodetectSourceLanguage* (producer) | Being able to autodetect the source 
language | false | boolean
+| *lazyStartProducer* (producer) | Whether the producer should be started lazy 
(on the first message). By starting lazy you can use this to allow CamelContext 
and routes to startup in situations where a producer may otherwise fail during 
starting and cause the route to fail being started. By deferring this startup 
to be lazy then the startup failure can be handled during routing messages via 
Camel's routing error handlers. Beware that when the first message is processed 
then creating and [...]
+| *operation* (producer) | *Required* The operation to perform |  | 
TranslateOperations
+| *proxyHost* (producer) | To define a proxy host when instantiating the 
Translate client |  | String
+| *proxyPort* (producer) | To define a proxy port when instantiating the 
Translate client |  | Integer
+| *proxyProtocol* (producer) | To define a proxy protocol when instantiating 
the Translate client | HTTPS | Protocol
+| *region* (producer) | The region in which Translate client needs to work. 
When using this parameter, the configuration will expect the capitalized name 
of the region (for example AP_EAST_1) You'll need to use the name 
Regions.EU_WEST_1.name() |  | String
+| *secretKey* (producer) | Amazon AWS Secret Key |  | String
+| *sourceLanguage* (producer) | Source language to use |  | String
+| *targetLanguage* (producer) | Target language to use |  | String
+| *translateClient* (producer) | To use a existing configured AWS Translate as 
client |  | TranslateClient
+| *basicPropertyBinding* (advanced) | Whether the endpoint should use basic 
property binding (Camel 2.x) or the newer property binding with additional 
capabilities | false | boolean
+| *synchronous* (advanced) | Sets whether synchronous processing should be 
strictly used, or Camel is allowed to use asynchronous processing (if 
supported). | false | boolean
+|===
+// endpoint options: END
+// spring-boot-auto-configure options: START
+// spring-boot-auto-configure options: END
+
+
+
+
+Required Translate component options
+
+You have to provide the amazonTranslateClient in the
+Registry or your accessKey and secretKey to access
+the https://aws.amazon.com/translate/[Amazon Translate] service.
+
+== Usage
+
+=== Message headers evaluated by the Translate producer
+
+[width="100%",cols="10%,10%,80%",options="header",]
+|=======================================================================
+|Header |Type |Description
+
+|`CamelAwsTranslateSourceLanguage` |`String` |The text source language
+
+|`CamelAwsTranslateTargetLanguage` |`String` |The text target language
+
+|`CamelAwsTranslateTerminologyNames` |`String` |The terminologies to use
+
+|`CamelAwsTranslateOperation` |`String` |The operation to perform
+|=======================================================================
+
+=== Translate Producer operations
+
+Camel-AWS Translate component provides the following operation on the producer 
side:
+
+- translateText
+
+== Automatic detection of AmazonTranslate client in registry
+
+The component is capable of detecting the presence of an AmazonTranslate bean 
into the registry.
+If it's the only instance of that type it will be used as client and you won't 
have to define it as uri parameter.
+This may be really useful for smarter configuration of the endpoint.
+
+== Translate Text example
+
+------------------------------------------------------------------------------------------------------
+from("direct:start")
+  .setHeader(TranslateConstants.SOURCE_LANGUAGE, TranslateLanguageEnum.ITALIAN)
+  .setHeader(TranslateConstants.TARGET_LANGUAGE, TranslateLanguageEnum.GERMAN)
+  .setBody("Ciao")
+  
.to("aws-translate://test?translateClient=#amazonTranslateClient&operation=translateText");
+------------------------------------------------------------------------------------------------------
+
+As result you'll get an exchange containing the translated text.
+
+Dependencies
+
+Maven users will need to add the following dependency to their pom.xml.
+
+*pom.xml*
+
+[source,xml]
+---------------------------------------
+<dependency>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>camel-aws2-translate</artifactId>
+    <version>${camel-version}</version>
+</dependency>
+---------------------------------------
+
+where `$\{camel-version\}` must be replaced by the actual version of Camel.
\ No newline at end of file
diff --git 
a/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateComponent.java
 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateComponent.java
new file mode 100644
index 0000000..f888807
--- /dev/null
+++ 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateComponent.java
@@ -0,0 +1,123 @@
+/*
+ * 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.component.aws2.translate;
+
+import java.util.Map;
+import java.util.Set;
+
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.annotations.Component;
+import org.apache.camel.support.DefaultComponent;
+import org.apache.camel.util.ObjectHelper;
+
+import software.amazon.awssdk.services.translate.TranslateClient;
+
+/**
+ * For working with Amazon Translate.
+ */
+@Component("aws2-translate")
+public class TranslateComponent extends DefaultComponent {
+
+    @Metadata
+    private String accessKey;
+    @Metadata
+    private String secretKey;
+    @Metadata
+    private String region;
+    @Metadata(label = "advanced")
+    private TranslateConfiguration configuration;
+
+    public TranslateComponent() {
+        this(null);
+    }
+
+    public TranslateComponent(CamelContext context) {
+        super(context);
+
+        registerExtension(new TranslateComponentVerifierExtension());
+    }
+
+    @Override
+    protected Endpoint createEndpoint(String uri, String remaining, 
Map<String, Object> parameters) throws Exception {
+        TranslateConfiguration configuration = this.configuration != null ? 
this.configuration.copy() : new TranslateConfiguration();
+
+        TranslateEndpoint endpoint = new TranslateEndpoint(uri, this, 
configuration);
+        endpoint.getConfiguration().setAccessKey(accessKey);
+        endpoint.getConfiguration().setSecretKey(secretKey);
+        endpoint.getConfiguration().setRegion(region);
+        setProperties(endpoint, parameters);
+        checkAndSetRegistryClient(configuration);
+        if (configuration.getTranslateClient() == null && 
(configuration.getAccessKey() == null || configuration.getSecretKey() == null)) 
{
+            throw new IllegalArgumentException("Amazon translate client or 
accessKey and secretKey must be specified");
+        }
+        return endpoint;
+    }
+
+    public TranslateConfiguration getConfiguration() {
+        return configuration;
+    }
+
+    /**
+     * The AWS Translate default configuration
+     */
+    public void setConfiguration(TranslateConfiguration configuration) {
+        this.configuration = configuration;
+    }
+
+    public String getAccessKey() {
+        return accessKey;
+    }
+
+    /**
+     * Amazon AWS Access Key
+     */
+    public void setAccessKey(String accessKey) {
+        this.accessKey = accessKey;
+    }
+
+    public String getSecretKey() {
+        return secretKey;
+    }
+
+    /**
+     * Amazon AWS Secret Key
+     */
+    public void setSecretKey(String secretKey) {
+        this.secretKey = secretKey;
+    }
+
+    public String getRegion() {
+        return region;
+    }
+
+    /**
+     * The region in which Translate client needs to work
+     */
+    public void setRegion(String region) {
+        this.region = region;
+    }
+
+    private void checkAndSetRegistryClient(TranslateConfiguration 
configuration) {
+        Set<TranslateClient> clients = 
getCamelContext().getRegistry().findByType(TranslateClient.class);
+        if (clients.size() == 1) {
+            
configuration.setTranslateClient(clients.stream().findFirst().get());
+        }
+    }
+}
diff --git 
a/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateComponentVerifierExtension.java
 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateComponentVerifierExtension.java
new file mode 100644
index 0000000..3e39093
--- /dev/null
+++ 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateComponentVerifierExtension.java
@@ -0,0 +1,87 @@
+/*
+ * 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.component.aws2.translate;
+
+import java.util.Map;
+
+import 
org.apache.camel.component.extension.verifier.DefaultComponentVerifierExtension;
+import org.apache.camel.component.extension.verifier.ResultBuilder;
+import org.apache.camel.component.extension.verifier.ResultErrorBuilder;
+import org.apache.camel.component.extension.verifier.ResultErrorHelper;
+
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
+import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
+import software.amazon.awssdk.core.exception.SdkClientException;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.translate.TranslateClient;
+import software.amazon.awssdk.services.translate.TranslateClientBuilder;
+import software.amazon.awssdk.services.translate.model.TranslateTextRequest;
+
+public class TranslateComponentVerifierExtension extends 
DefaultComponentVerifierExtension {
+
+    public TranslateComponentVerifierExtension() {
+        this("aws2-translate");
+    }
+
+    public TranslateComponentVerifierExtension(String scheme) {
+        super(scheme);
+    }
+
+    // *********************************
+    // Parameters validation
+    // *********************************
+
+    @Override
+    protected Result verifyParameters(Map<String, Object> parameters) {
+
+        ResultBuilder builder = 
ResultBuilder.withStatusAndScope(Result.Status.OK, 
Scope.PARAMETERS).error(ResultErrorHelper.requiresOption("accessKey", 
parameters))
+            .error(ResultErrorHelper.requiresOption("secretKey", 
parameters)).error(ResultErrorHelper.requiresOption("region", parameters));
+
+        // Validate using the catalog
+
+        super.verifyParametersAgainstCatalog(builder, parameters);
+
+        return builder.build();
+    }
+
+    // *********************************
+    // Connectivity validation
+    // *********************************
+
+    @Override
+    protected Result verifyConnectivity(Map<String, Object> parameters) {
+        ResultBuilder builder = 
ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.CONNECTIVITY);
+
+        try {
+            TranslateConfiguration configuration = setProperties(new 
TranslateConfiguration(), parameters);
+            AwsCredentialsProvider credentialsProvider = 
DefaultCredentialsProvider.create();
+            TranslateClientBuilder clientBuilder = TranslateClient.builder();
+            TranslateClient client = 
clientBuilder.credentialsProvider(credentialsProvider).region(Region.of(configuration.getRegion())).build();
+            TranslateTextRequest req = 
TranslateTextRequest.builder().sourceLanguageCode("it").targetLanguageCode("en").text("ciao").build();
+            client.translateText(req);
+               } catch (SdkClientException e) {
+            ResultErrorBuilder errorBuilder = 
ResultErrorBuilder.withCodeAndDescription(VerificationError.StandardCode.AUTHENTICATION,
 e.getMessage())
+                .detail("aws_translate_exception_message", 
e.getMessage()).detail(VerificationError.ExceptionAttribute.EXCEPTION_CLASS, 
e.getClass().getName())
+                
.detail(VerificationError.ExceptionAttribute.EXCEPTION_INSTANCE, e);
+
+            builder.error(errorBuilder.build());
+        } catch (Exception e) {
+            builder.error(ResultErrorBuilder.withException(e).build());
+        }
+        return builder.build();
+    }
+}
diff --git 
a/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateConfiguration.java
 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateConfiguration.java
new file mode 100644
index 0000000..51fce9f
--- /dev/null
+++ 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateConfiguration.java
@@ -0,0 +1,193 @@
+/*
+ * 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.component.aws2.translate;
+
+import software.amazon.awssdk.core.Protocol;
+import software.amazon.awssdk.services.translate.TranslateClient;
+
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
+import org.apache.camel.spi.UriPath;
+
+@UriParams
+public class TranslateConfiguration implements Cloneable {
+
+    @UriPath(description = "Logical name")
+    @Metadata(required = true)
+    private String label;
+    @UriParam(label = "producer")
+    private TranslateClient translateClient;
+    @UriParam(label = "producer", secret = true)
+    private String accessKey;
+    @UriParam(label = "producer", secret = true)
+    private String secretKey;
+    @UriParam(label = "producer")
+    @Metadata(required = true, defaultValue = "translateText")
+    private TranslateOperations operation = TranslateOperations.translateText;
+    @UriParam(enums = "HTTP,HTTPS", defaultValue = "HTTPS")
+    private Protocol proxyProtocol = Protocol.HTTPS;
+    @UriParam(label = "producer")
+    private String proxyHost;
+    @UriParam(label = "producer")
+    private String sourceLanguage;
+    @UriParam(label = "producer")
+    private String targetLanguage;
+    @UriParam(label = "producer")
+    private Integer proxyPort;
+    @UriParam
+    private String region;
+    @UriParam(label = "producer", defaultValue = "false")
+    private boolean autodetectSourceLanguage;
+
+    public TranslateClient getTranslateClient() {
+        return translateClient;
+    }
+
+    /**
+     * To use a existing configured AWS Translate as client
+     */
+    public void setTranslateClient(TranslateClient translateClient) {
+        this.translateClient = translateClient;
+    }
+
+    public String getAccessKey() {
+        return accessKey;
+    }
+
+    /**
+     * Amazon AWS Access Key
+     */
+    public void setAccessKey(String accessKey) {
+        this.accessKey = accessKey;
+    }
+
+    public String getSecretKey() {
+        return secretKey;
+    }
+
+    /**
+     * Amazon AWS Secret Key
+     */
+    public void setSecretKey(String secretKey) {
+        this.secretKey = secretKey;
+    }
+
+    public TranslateOperations getOperation() {
+        return operation;
+    }
+
+    /**
+     * The operation to perform
+     */
+    public void setOperation(TranslateOperations operation) {
+        this.operation = operation;
+    }
+
+    public Protocol getProxyProtocol() {
+        return proxyProtocol;
+    }
+
+    /**
+     * To define a proxy protocol when instantiating the Translate client
+     */
+    public void setProxyProtocol(Protocol proxyProtocol) {
+        this.proxyProtocol = proxyProtocol;
+    }
+
+    public String getProxyHost() {
+        return proxyHost;
+    }
+
+    /**
+     * To define a proxy host when instantiating the Translate client
+     */
+    public void setProxyHost(String proxyHost) {
+        this.proxyHost = proxyHost;
+    }
+
+    public Integer getProxyPort() {
+        return proxyPort;
+    }
+
+    /**
+     * To define a proxy port when instantiating the Translate client
+     */
+    public void setProxyPort(Integer proxyPort) {
+        this.proxyPort = proxyPort;
+    }
+
+    public String getRegion() {
+        return region;
+    }
+
+    /**
+     * The region in which Translate client needs to work. When using this
+     * parameter, the configuration will expect the capitalized name of the
+     * region (for example AP_EAST_1) You'll need to use the name
+     * Regions.EU_WEST_1.name()
+     */
+    public void setRegion(String region) {
+        this.region = region;
+    }
+
+    public boolean isAutodetectSourceLanguage() {
+        return autodetectSourceLanguage;
+    }
+
+    /**
+     * Being able to autodetect the source language
+     */
+    public void setAutodetectSourceLanguage(boolean autodetectSourceLanguage) {
+        this.autodetectSourceLanguage = autodetectSourceLanguage;
+    }
+
+    public String getSourceLanguage() {
+        return sourceLanguage;
+    }
+
+    /**
+     * Source language to use
+     */
+    public void setSourceLanguage(String sourceLanguage) {
+        this.sourceLanguage = sourceLanguage;
+    }
+
+    public String getTargetLanguage() {
+        return targetLanguage;
+    }
+
+    /**
+     * Target language to use
+     */
+    public void setTargetLanguage(String targetLanguage) {
+        this.targetLanguage = targetLanguage;
+    }
+
+    // *************************************************
+    //
+    // *************************************************
+
+    public TranslateConfiguration copy() {
+        try {
+            return (TranslateConfiguration)super.clone();
+        } catch (CloneNotSupportedException e) {
+            throw new RuntimeCamelException(e);
+        }
+    }
+}
diff --git 
a/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateConstants.java
 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateConstants.java
new file mode 100644
index 0000000..598c036
--- /dev/null
+++ 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateConstants.java
@@ -0,0 +1,27 @@
+/*
+ * 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.component.aws2.translate;
+
+/**
+ * Constants used in Camel AWS Translate module
+ */
+public interface TranslateConstants {
+    String SOURCE_LANGUAGE = "CamelAwsTranslateSourceLanguage";
+    String TARGET_LANGUAGE = "CamelAwsTranslateTargetLanguage";
+    String TERMINOLOGY_NAMES = "CamelAwsTranslateTerminologyNames";
+    String OPERATION = "CamelAwsTranslateOperation";
+}
diff --git 
a/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateEndpoint.java
 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateEndpoint.java
new file mode 100644
index 0000000..10a5360
--- /dev/null
+++ 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateEndpoint.java
@@ -0,0 +1,122 @@
+/*
+ * 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.component.aws2.translate;
+
+import java.net.URI;
+
+import org.apache.camel.Component;
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.support.ScheduledPollEndpoint;
+import org.apache.camel.util.ObjectHelper;
+
+import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
+import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
+import software.amazon.awssdk.http.apache.ApacheHttpClient;
+import software.amazon.awssdk.http.apache.ProxyConfiguration;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.translate.TranslateClient;
+import software.amazon.awssdk.services.translate.TranslateClientBuilder;
+
+/**
+ * The aws2-translate component is used for managing Amazon Translate
+ */
+@UriEndpoint(firstVersion = "3.1.0", scheme = "aws2-translate", title = "AWS 
Translate", syntax = "aws2-translate:label", producerOnly = true, label = 
"cloud,management")
+public class TranslateEndpoint extends ScheduledPollEndpoint {
+
+    private TranslateClient translateClient;
+
+    @UriParam
+    private TranslateConfiguration configuration;
+
+    public TranslateEndpoint(String uri, Component component, 
TranslateConfiguration configuration) {
+        super(uri, component);
+        this.configuration = configuration;
+    }
+
+    @Override
+    public Consumer createConsumer(Processor processor) throws Exception {
+        throw new UnsupportedOperationException("You cannot receive messages 
from this endpoint");
+    }
+
+    @Override
+    public Producer createProducer() throws Exception {
+        return new TranslateProducer(this);
+    }
+
+    @Override
+    public void doStart() throws Exception {
+        super.doStart();
+
+        translateClient = configuration.getTranslateClient() != null ? 
configuration.getTranslateClient() : createTranslateClient();
+    }
+
+    @Override
+    public void doStop() throws Exception {
+        if (ObjectHelper.isEmpty(configuration.getTranslateClient())) {
+            if (translateClient != null) {
+                translateClient.close();
+            }
+        }
+        super.doStop();
+    }
+
+    public TranslateConfiguration getConfiguration() {
+        return configuration;
+    }
+
+    public TranslateClient getTranslateClient() {
+        return translateClient;
+    }
+
+    TranslateClient createTranslateClient() {
+        TranslateClient client = null;
+        TranslateClientBuilder clientBuilder = TranslateClient.builder();
+       ProxyConfiguration.Builder proxyConfig = null;
+       ApacheHttpClient.Builder httpClientBuilder = null;
+        boolean isClientConfigFound = false;
+        if (ObjectHelper.isNotEmpty(configuration.getProxyHost()) && 
ObjectHelper.isNotEmpty(configuration.getProxyPort())) {
+               proxyConfig = ProxyConfiguration.builder();
+               URI proxyEndpoint = URI.create(configuration.getProxyProtocol() 
+ configuration.getProxyHost() + configuration.getProxyPort());
+               proxyConfig.endpoint(proxyEndpoint);
+               httpClientBuilder = 
+                       ApacheHttpClient.builder()
+                                       
.proxyConfiguration(proxyConfig.build());
+            isClientConfigFound = true;
+        }
+        if (configuration.getAccessKey() != null && 
configuration.getSecretKey() != null) {
+               AwsBasicCredentials cred = 
AwsBasicCredentials.create(configuration.getAccessKey(), 
configuration.getSecretKey());
+            if (isClientConfigFound) {
+                clientBuilder = 
clientBuilder.httpClientBuilder(httpClientBuilder).credentialsProvider(StaticCredentialsProvider.create(cred));
+            } else {
+                clientBuilder = 
clientBuilder.credentialsProvider(StaticCredentialsProvider.create(cred));
+            }
+        } else {
+            if (!isClientConfigFound) {
+                clientBuilder = 
clientBuilder.httpClientBuilder(httpClientBuilder);
+            }
+        }
+        if (ObjectHelper.isNotEmpty(configuration.getRegion())) {
+            clientBuilder = 
clientBuilder.region(Region.of(configuration.getRegion()));
+        }
+        client = clientBuilder.build();
+        return client;
+    }
+}
diff --git 
a/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateLanguageEnum.java
 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateLanguageEnum.java
new file mode 100644
index 0000000..7df9ec9
--- /dev/null
+++ 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateLanguageEnum.java
@@ -0,0 +1,36 @@
+/*
+ * 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.component.aws2.translate;
+
+public enum TranslateLanguageEnum {
+
+    ARABIC("ar"), CHINESE_SIMPLIFIED("zh"), CHINESE_TRADITIONAL("zh-TW"), 
CZECH("cs"), DANISH("da"), DUTCH("nl"), ENGLISH("en"), FINNISH("fi"), 
FRENCH("fr"), GERMAN("de"), HEBREW(
+        "he"), HINDI("hi"), INDONESIAN("id"), ITALIAN("it"), JAPANESE(
+            "ja"), KOREAN("ko"), MALAY("ms"), NORWEGIAN("no"), PERSIAN("fa"), 
POLISH("pl"), PORTUGUESE("pt"), RUSSIAN("ru"), SPANISH("es"), SWEDISH("sv"), 
TURKISH("tr");
+
+    private final String language;
+
+    TranslateLanguageEnum(final String language) {
+        this.language = language;
+    }
+
+    @Override
+    public String toString() {
+        return language;
+    }
+
+}
diff --git 
a/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateOperations.java
 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateOperations.java
new file mode 100644
index 0000000..99a474a
--- /dev/null
+++ 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateOperations.java
@@ -0,0 +1,22 @@
+/*
+ * 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.component.aws2.translate;
+
+public enum TranslateOperations {
+
+    translateText
+}
diff --git 
a/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateProducer.java
 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateProducer.java
new file mode 100644
index 0000000..ef758b3
--- /dev/null
+++ 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/TranslateProducer.java
@@ -0,0 +1,130 @@
+/*
+ * 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.component.aws2.translate;
+
+import java.util.Collection;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.support.DefaultProducer;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.URISupport;
+
+import software.amazon.awssdk.awscore.exception.AwsServiceException;
+import software.amazon.awssdk.services.translate.TranslateClient;
+import software.amazon.awssdk.services.translate.model.TranslateTextRequest;
+import 
software.amazon.awssdk.services.translate.model.TranslateTextRequest.Builder;
+import software.amazon.awssdk.services.translate.model.TranslateTextResponse;
+
+/**
+ * A Producer which sends messages to the Amazon Translate Service
+ * <a href="http://aws.amazon.com/translate/";>AWS Translate</a>
+ */
+public class TranslateProducer extends DefaultProducer {
+
+    private transient String translateProducerToString;
+
+    public TranslateProducer(Endpoint endpoint) {
+        super(endpoint);
+    }
+
+    @Override
+    public void process(Exchange exchange) throws Exception {
+        switch (determineOperation(exchange)) {
+        case translateText:
+            translateText(getEndpoint().getTranslateClient(), exchange);
+            break;
+        default:
+            throw new IllegalArgumentException("Unsupported operation");
+        }
+    }
+
+    private TranslateOperations determineOperation(Exchange exchange) {
+        TranslateOperations operation = 
exchange.getIn().getHeader(TranslateConstants.OPERATION, 
TranslateOperations.class);
+        if (operation == null) {
+            operation = getConfiguration().getOperation();
+        }
+        return operation;
+    }
+
+    protected TranslateConfiguration getConfiguration() {
+        return getEndpoint().getConfiguration();
+    }
+
+    @Override
+    public String toString() {
+        if (translateProducerToString == null) {
+            translateProducerToString = "TranslateProducer[" + 
URISupport.sanitizeUri(getEndpoint().getEndpointUri()) + "]";
+        }
+        return translateProducerToString;
+    }
+
+    @Override
+    public TranslateEndpoint getEndpoint() {
+        return (TranslateEndpoint)super.getEndpoint();
+    }
+
+    private void translateText(TranslateClient translateClient, Exchange 
exchange) {
+        Builder request = TranslateTextRequest.builder();
+        if (!getConfiguration().isAutodetectSourceLanguage()) {
+            if (ObjectHelper.isEmpty(getConfiguration().getSourceLanguage()) 
&& ObjectHelper.isEmpty(getConfiguration().getTargetLanguage())) {
+                String source = 
exchange.getIn().getHeader(TranslateConstants.SOURCE_LANGUAGE, String.class);
+                String target = 
exchange.getIn().getHeader(TranslateConstants.TARGET_LANGUAGE, String.class);
+                if (ObjectHelper.isEmpty(source) || 
ObjectHelper.isEmpty(target)) {
+                    throw new IllegalArgumentException("Source and target 
language must be specified as headers or endpoint options");
+                }
+                request.sourceLanguageCode(source);
+                request.targetLanguageCode(target);
+            } else {
+                
request.sourceLanguageCode(getConfiguration().getSourceLanguage());
+                
request.targetLanguageCode(getConfiguration().getTargetLanguage());
+            }
+        } else {
+            String source = "auto";
+            if (ObjectHelper.isEmpty(getConfiguration().getTargetLanguage())) {
+                String target = 
exchange.getIn().getHeader(TranslateConstants.TARGET_LANGUAGE, String.class);
+                if (ObjectHelper.isEmpty(source) || 
ObjectHelper.isEmpty(target)) {
+                    throw new IllegalArgumentException("Target language must 
be specified when autodetection of source language is enabled");
+                }
+                request.sourceLanguageCode(source);
+                request.targetLanguageCode(target);
+            } else {
+                request.sourceLanguageCode(source);
+                
request.targetLanguageCode(getConfiguration().getTargetLanguage());
+            }
+        }
+        if 
(!ObjectHelper.isEmpty(exchange.getIn().getHeader(TranslateConstants.TERMINOLOGY_NAMES,
 Collection.class))) {
+            Collection<String> terminologies = 
exchange.getIn().getHeader(TranslateConstants.TERMINOLOGY_NAMES, 
Collection.class);
+            request.terminologyNames(terminologies);
+        }
+        request.text(exchange.getMessage().getBody(String.class));
+        TranslateTextResponse result;
+        try {
+            result = translateClient.translateText(request.build());
+        } catch (AwsServiceException ase) {
+            log.trace("Translate Text command returned the error code {}", 
ase.getMessage());
+            throw ase;
+        }
+        Message message = getMessageForResponse(exchange);
+        message.setBody(result.translatedText());
+    }
+
+    public static Message getMessageForResponse(final Exchange exchange) {
+        return exchange.getMessage();
+    }
+}
diff --git 
a/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/AmazonAWSTranslateMock.java
 
b/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/AmazonAWSTranslateMock.java
new file mode 100644
index 0000000..77d332b
--- /dev/null
+++ 
b/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/AmazonAWSTranslateMock.java
@@ -0,0 +1,42 @@
+/*
+ * 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.component.aws2.translate;
+
+import software.amazon.awssdk.services.translate.TranslateClient;
+import software.amazon.awssdk.services.translate.model.TranslateTextRequest;
+import software.amazon.awssdk.services.translate.model.TranslateTextResponse;
+
+public class AmazonAWSTranslateMock implements TranslateClient {
+
+    @Override
+    public TranslateTextResponse translateText(TranslateTextRequest request) {
+       TranslateTextResponse result = 
TranslateTextResponse.builder().translatedText("Hello").build();
+        return result;
+    }
+
+       @Override
+       public String serviceName() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public void close() {
+               // TODO Auto-generated method stub
+               
+       }
+}
diff --git 
a/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/TranslateProducerSpringTest.java
 
b/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/TranslateProducerSpringTest.java
new file mode 100644
index 0000000..370425b
--- /dev/null
+++ 
b/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/TranslateProducerSpringTest.java
@@ -0,0 +1,60 @@
+/*
+ * 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.component.aws2.translate;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.component.aws2.translate.TranslateConstants;
+import org.apache.camel.component.aws2.translate.TranslateLanguageEnum;
+import org.apache.camel.component.aws2.translate.TranslateOperations;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.spring.CamelSpringTestSupport;
+import org.junit.Test;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class TranslateProducerSpringTest extends CamelSpringTestSupport {
+
+    @EndpointInject("mock:result")
+    private MockEndpoint mock;
+
+    @Test
+    public void translateTextTest() throws Exception {
+
+        mock.expectedMessageCount(1);
+        Exchange exchange = template.request("direct:translateText", new 
Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setHeader(TranslateConstants.OPERATION, 
TranslateOperations.translateText);
+                exchange.getIn().setHeader(TranslateConstants.SOURCE_LANGUAGE, 
TranslateLanguageEnum.ITALIAN);
+                exchange.getIn().setHeader(TranslateConstants.TARGET_LANGUAGE, 
TranslateLanguageEnum.ENGLISH);
+                exchange.getIn().setBody("ciao");
+            }
+        });
+
+        assertMockEndpointsSatisfied();
+
+        String resultGet = exchange.getIn().getBody(String.class);
+        assertEquals("Hello", resultGet);
+
+    }
+
+    @Override
+    protected ClassPathXmlApplicationContext createApplicationContext() {
+        return new 
ClassPathXmlApplicationContext("org/apache/camel/component/aws2/translate/TranslateComponentSpringTest-context.xml");
+    }
+}
diff --git 
a/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/TranslateProducerTest.java
 
b/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/TranslateProducerTest.java
new file mode 100644
index 0000000..cc4dcad
--- /dev/null
+++ 
b/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/TranslateProducerTest.java
@@ -0,0 +1,87 @@
+/*
+ * 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.component.aws2.translate;
+
+import org.apache.camel.BindToRegistry;
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.aws2.translate.TranslateConstants;
+import org.apache.camel.component.aws2.translate.TranslateLanguageEnum;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class TranslateProducerTest extends CamelTestSupport {
+
+    @BindToRegistry("amazonTranslateClient")
+    AmazonAWSTranslateMock clientMock = new AmazonAWSTranslateMock();
+
+    @EndpointInject("mock:result")
+    private MockEndpoint mock;
+
+    @Test
+    public void translateTextTest() throws Exception {
+
+        mock.expectedMessageCount(1);
+        Exchange exchange = template.request("direct:translateText", new 
Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setHeader(TranslateConstants.SOURCE_LANGUAGE, 
TranslateLanguageEnum.ITALIAN);
+                exchange.getIn().setHeader(TranslateConstants.TARGET_LANGUAGE, 
TranslateLanguageEnum.ENGLISH);
+                exchange.getIn().setBody("ciao");
+            }
+        });
+
+        assertMockEndpointsSatisfied();
+
+        String resultGet = exchange.getIn().getBody(String.class);
+        assertEquals("Hello", resultGet);
+
+    }
+
+    @Test
+    public void translateTextTestOptions() throws Exception {
+
+        mock.expectedMessageCount(1);
+        Exchange exchange = template.request("direct:translateTextOptions", 
new Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setBody("ciao");
+            }
+        });
+
+        assertMockEndpointsSatisfied();
+
+        String resultGet = exchange.getIn().getBody(String.class);
+        assertEquals("Hello", resultGet);
+
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                
from("direct:translateText").to("aws2-translate://test?translateClient=#amazonTranslateClient&operation=translateText").to("mock:result");
+                
from("direct:translateTextOptions").to("aws2-translate://test?translateClient=#amazonTranslateClient&operation=translateText&sourceLanguage=it&targetLanguage=en")
+                    .to("mock:result");
+            }
+        };
+    }
+}
diff --git 
a/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/integration/TranslateProducerIntegrationTest.java
 
b/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/integration/TranslateProducerIntegrationTest.java
new file mode 100644
index 0000000..8445653
--- /dev/null
+++ 
b/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/integration/TranslateProducerIntegrationTest.java
@@ -0,0 +1,87 @@
+/*
+ * 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.component.aws2.translate.integration;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.aws2.translate.TranslateConstants;
+import org.apache.camel.component.aws2.translate.TranslateLanguageEnum;
+import org.apache.camel.component.aws2.translate.TranslateOperations;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Ignore;
+import org.junit.Test;
+
+@Ignore("This test must be manually started, you need to specify AWS 
Credentials")
+public class TranslateProducerIntegrationTest extends CamelTestSupport {
+
+    @EndpointInject("mock:result")
+    private MockEndpoint mock;
+
+    @Test
+    public void translateTextTest() throws Exception {
+
+        mock.expectedMessageCount(1);
+        Exchange exchange = template.request("direct:translateText", new 
Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setHeader(TranslateConstants.OPERATION, 
TranslateOperations.translateText);
+                exchange.getIn().setHeader(TranslateConstants.SOURCE_LANGUAGE, 
TranslateLanguageEnum.ITALIAN);
+                exchange.getIn().setHeader(TranslateConstants.TARGET_LANGUAGE, 
TranslateLanguageEnum.GERMAN);
+                exchange.getIn().setBody("Ciao Signorina");
+            }
+        });
+
+        assertMockEndpointsSatisfied();
+
+        String resultGet = (String)exchange.getIn().getBody();
+        assertEquals("Hallo, Miss.", resultGet);
+    }
+
+    @Test
+    public void translateTextAutodetectSourceTest() throws Exception {
+
+        mock.expectedMessageCount(1);
+        Exchange exchange = template.request("direct:translateTextAuto", new 
Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setHeader(TranslateConstants.OPERATION, 
TranslateOperations.translateText);
+                exchange.getIn().setHeader(TranslateConstants.TARGET_LANGUAGE, 
TranslateLanguageEnum.GERMAN);
+                exchange.getIn().setBody("Ciao Signorina");
+            }
+        });
+
+        assertMockEndpointsSatisfied();
+
+        String resultGet = (String)exchange.getIn().getBody();
+        assertEquals("Hallo, Miss.", resultGet);
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                
from("direct:translateText").to("aws2-translate://test?accessKey=RAW(xxxx)&secretKey=RAW(xxxx)&region=eu-west-1&operation=translateText").to("mock:result");
+                from("direct:translateTextAuto")
+                    
.to("aws2-translate://test?accessKey=RAW(xxxx)&secretKey=RAW(xxxx)&region=eu-west-1&operation=translateText&autodetectSourceLanguage=true").to("mock:result");
+            }
+        };
+    }
+}
diff --git 
a/components/camel-aws2-translate/src/test/resources/log4j2.properties 
b/components/camel-aws2-translate/src/test/resources/log4j2.properties
new file mode 100644
index 0000000..1ef398f
--- /dev/null
+++ b/components/camel-aws2-translate/src/test/resources/log4j2.properties
@@ -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.
+## ---------------------------------------------------------------------------
+
+appender.file.type = File
+appender.file.name = file
+appender.file.fileName = target/camel-aws2-translate-test.log
+appender.file.layout.type = PatternLayout
+appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+appender.out.type = Console
+appender.out.name = out
+appender.out.layout.type = PatternLayout
+appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+rootLogger.level = INFO
+rootLogger.appenderRef.file.ref = file
diff --git 
a/components/camel-aws2-translate/src/test/resources/org/apache/camel/component/aws2/translate/TranslateComponentSpringTest-context.xml
 
b/components/camel-aws2-translate/src/test/resources/org/apache/camel/component/aws2/translate/TranslateComponentSpringTest-context.xml
new file mode 100644
index 0000000..1256d12
--- /dev/null
+++ 
b/components/camel-aws2-translate/src/test/resources/org/apache/camel/component/aws2/translate/TranslateComponentSpringTest-context.xml
@@ -0,0 +1,35 @@
+<?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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xsi:schemaLocation="
+    http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd
+    http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd";>
+
+    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring";>
+        <route>
+            <from uri="direct:translateText"/>
+            <to 
uri="aws2-translate://test?translateClient=#amazonTranslateClient&amp;operation=translateText"/>
+            <to uri="mock:result"/>
+        </route>
+    </camelContext>
+
+    <bean id="amazonTranslateClient" 
class="org.apache.camel.component.aws2.translate.AmazonAWSTranslateMock"/>
+</beans>
\ No newline at end of file
diff --git 
a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/TranslateEndpointBuilderFactory.java
 
b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/TranslateEndpointBuilderFactory.java
index b8f5922..3a508dc 100644
--- 
a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/TranslateEndpointBuilderFactory.java
+++ 
b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/TranslateEndpointBuilderFactory.java
@@ -22,7 +22,7 @@ import org.apache.camel.builder.EndpointProducerBuilder;
 import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
 
 /**
- * The aws-translate component is used for managing Amazon Translate
+ * The aws2-translate component is used for managing Amazon Translate
  * 
  * Generated by camel-package-maven-plugin - do not edit this file!
  */
@@ -120,7 +120,7 @@ public interface TranslateEndpointBuilderFactory {
          * The operation to perform.
          * 
          * The option is a:
-         * 
<code>org.apache.camel.component.aws.translate.TranslateOperations</code> type.
+         * 
<code>org.apache.camel.component.aws2.translate.TranslateOperations</code> type.
          * 
          * Required: true
          * Group: producer
@@ -133,7 +133,7 @@ public interface TranslateEndpointBuilderFactory {
          * The operation to perform.
          * 
          * The option will be converted to a
-         * 
<code>org.apache.camel.component.aws.translate.TranslateOperations</code> type.
+         * 
<code>org.apache.camel.component.aws2.translate.TranslateOperations</code> type.
          * 
          * Required: true
          * Group: producer
@@ -179,7 +179,8 @@ public interface TranslateEndpointBuilderFactory {
         /**
          * To define a proxy protocol when instantiating the Translate client.
          * 
-         * The option is a: <code>com.amazonaws.Protocol</code> type.
+         * The option is a: <code>software.amazon.awssdk.core.Protocol</code>
+         * type.
          * 
          * Default: HTTPS
          * Group: producer
@@ -191,8 +192,8 @@ public interface TranslateEndpointBuilderFactory {
         /**
          * To define a proxy protocol when instantiating the Translate client.
          * 
-         * The option will be converted to a 
<code>com.amazonaws.Protocol</code>
-         * type.
+         * The option will be converted to a
+         * <code>software.amazon.awssdk.core.Protocol</code> type.
          * 
          * Default: HTTPS
          * Group: producer
@@ -252,7 +253,7 @@ public interface TranslateEndpointBuilderFactory {
          * To use a existing configured AWS Translate as client.
          * 
          * The option is a:
-         * <code>com.amazonaws.services.translate.AmazonTranslate</code> type.
+         * 
<code>software.amazon.awssdk.services.translate.TranslateClient</code> type.
          * 
          * Group: producer
          */
@@ -264,7 +265,7 @@ public interface TranslateEndpointBuilderFactory {
          * To use a existing configured AWS Translate as client.
          * 
          * The option will be converted to a
-         * <code>com.amazonaws.services.translate.AmazonTranslate</code> type.
+         * 
<code>software.amazon.awssdk.services.translate.TranslateClient</code> type.
          * 
          * Group: producer
          */
@@ -341,29 +342,28 @@ public interface TranslateEndpointBuilderFactory {
 
     /**
      * Proxy enum for
-     * 
<code>org.apache.camel.component.aws.translate.TranslateOperations</code>
-     * enum.
+     * 
<code>org.apache.camel.component.aws2.translate.TranslateOperations</code> enum.
      */
     enum TranslateOperations {
         translateText;
     }
 
     /**
-     * Proxy enum for <code>com.amazonaws.Protocol</code> enum.
+     * Proxy enum for <code>software.amazon.awssdk.core.Protocol</code> enum.
      */
     enum Protocol {
         http,
         https;
     }
     /**
-     * AWS Translate (camel-aws-translate)
-     * The aws-translate component is used for managing Amazon Translate
+     * AWS Translate (camel-aws2-translate)
+     * The aws2-translate component is used for managing Amazon Translate
      * 
      * Category: cloud,management
-     * Since: 3.0
-     * Maven coordinates: org.apache.camel:camel-aws-translate
+     * Since: 3.1
+     * Maven coordinates: org.apache.camel:camel-aws2-translate
      * 
-     * Syntax: <code>aws-translate:label</code>
+     * Syntax: <code>aws2-translate:label</code>
      * 
      * Path parameter: label (required)
      * Logical name
@@ -371,9 +371,9 @@ public interface TranslateEndpointBuilderFactory {
     static TranslateEndpointBuilder awsTranslate(String path) {
         class TranslateEndpointBuilderImpl extends AbstractEndpointBuilder 
implements TranslateEndpointBuilder, AdvancedTranslateEndpointBuilder {
             public TranslateEndpointBuilderImpl(String path) {
-                super("aws-translate", path);
+                super("aws2-translate", path);
             }
         }
         return new TranslateEndpointBuilderImpl(path);
     }
-}
\ No newline at end of file
+}
diff --git a/parent/pom.xml b/parent/pom.xml
index 6c8ce08..508a742 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -87,6 +87,7 @@
         <awaitility-version>4.0.2</awaitility-version>
         <aws-java-sdk-bundle-version>1.11.699_1</aws-java-sdk-bundle-version>
         <aws-java-sdk-version>1.11.699</aws-java-sdk-version>
+        <aws-java-sdk2-version>2.10.49</aws-java-sdk2-version>
         <aws-java-sdk-swf-libs>1.11.22</aws-java-sdk-swf-libs>
         <aws-xray-version>2.4.0</aws-xray-version>
         <axiom-version>1.2.14</axiom-version>

Reply via email to