[ 
https://issues.apache.org/jira/browse/CAMEL-18097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17538807#comment-17538807
 ] 

Andrea Cosentino edited comment on CAMEL-18097 at 5/18/22 12:43 PM:
--------------------------------------------------------------------

With an xml like this:

{code:xml}
<?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.springboot.example</groupId>
        <artifactId>examples</artifactId>
        <version>3.17.0-SNAPSHOT</version>
    </parent>

    <artifactId>camel-example-spring-boot-aws2-sts</artifactId>
    <name>Camel SB Examples :: AWS2 STS</name>
    <description>An example showing the Camel AWS2 STS component with Spring 
Boot</description>

    <properties>
        <category>Cloud</category>
    </properties>

    <!-- Spring-Boot and Camel BOM -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>2.6.4</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.camel.springboot</groupId>
                <artifactId>camel-spring-boot-bom</artifactId>
                <version>3.14.2</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- Camel -->
        <dependency>
            <groupId>org.apache.camel.springboot</groupId>
            <artifactId>camel-spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel.springboot</groupId>
            <artifactId>camel-aws2-sts-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel.springboot</groupId>
            <artifactId>camel-timer-starter</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.6.4</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>


</project>
{code}

An application.properties like this:


{code:java}
camel.component.aws2-sts.accessKey=xxxx
camel.component.aws2-sts.secretKey=yyyyy
camel.component.aws2-sts.region=eu-central-1
camel.springboot.main-run-controller=true
logging.config=classpath:logback.xml
camel.component.aws2-sts.override-endpoint=true 
camel.component.aws2-sts.uri-endpoint-override=https://vpce-pippo-pluto.sts.eu.central1.vpce.amazonaws.com
{code}

and a route like:


{code:java}
/*
 * 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.example.springboot.aws2sts;

import org.apache.camel.builder.RouteBuilder;
import org.springframework.stereotype.Component;

@Component
public class CamelRoute extends RouteBuilder {

    @Override
    public void configure() throws Exception {

      from("timer://tick?period=1000")
                .to("aws2-sts://label?operation=getSessionToken");
    }
}
{code}

I'm getting the following error:


{code:java}
[INFO] --- spring-boot-maven-plugin:2.6.4:run (default-cli) @ 
camel-example-spring-boot-aws2-sts ---
[INFO] Attaching agents: []

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.6.4)

14:38:40.132 [main           ] INFO  .springboot.aws2s3.Application - Starting 
Application using Java 11.0.15 on ghost with PID 31495 
(/home/oscerd/workspace/apache-camel/camel-spring-boot-examples/aws2-sts/target/classes
 started by oscerd in 
/home/oscerd/workspace/apache-camel/camel-spring-boot-examples/aws2-sts)
14:38:40.133 [main           ] INFO  .springboot.aws2s3.Application - No active 
profile set, falling back to 1 default profile: "default"
14:38:41.242 [main           ] INFO  lSpringBootApplicationListener - Starting 
CamelMainRunController to ensure the main thread keeps running
14:38:41.248 [main           ] INFO  pl.engine.AbstractCamelContext - Routes 
startup (total:1 started:1)
14:38:41.249 [main           ] INFO  pl.engine.AbstractCamelContext -     
Started route1 (timer://tick)
14:38:41.249 [main           ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.14.2 (camel-1) started in 328ms (build:20ms init:75ms start:233ms)
14:38:41.252 [main           ] INFO  .springboot.aws2s3.Application - Started 
Application in 1.316 seconds (JVM running for 1.623)
14:38:52.603 [ - timer://tick] ERROR rorhandler.DefaultErrorHandler - Failed 
delivery for (MessageId: 8C5BB76A269F72A-0000000000000000 on ExchangeId: 
8C5BB76A269F72A-0000000000000000). Exhausted after delivery attempt: 1 caught: 
software.amazon.awssdk.core.exception.SdkClientException: Received an 
UnknownHostException when attempting to interact with a service. See cause for 
the exact endpoint that is failing to resolve. If this is happening on an 
endpoint that previously worked, there may be a network connectivity issue or 
your DNS cache could be storing endpoints for too long.

Message History (complete message history is disabled)
---------------------------------------------------------------------------------------------------------------------------------------
RouteId              ProcessorId          Processor                             
                                           Elapsed (ms)
[route1            ] [route1            ] [from[timer://tick?period=1000]       
                                         ] [     10353]
        ...
[route1            ] [to1               ] 
[aws2-sts://peppe?operation=getSessionToken                                    
] [         0]

Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------

software.amazon.awssdk.core.exception.SdkClientException: Received an 
UnknownHostException when attempting to interact with a service. See cause for 
the exact endpoint that is failing to resolve. If this is happening on an 
endpoint that previously worked, there may be a network connectivity issue or 
your DNS cache could be storing endpoints for too long.
        at 
software.amazon.awssdk.core.exception.SdkClientException$BuilderImpl.build(SdkClientException.java:98)
        at 
software.amazon.awssdk.awscore.interceptor.HelpfulUnknownHostExceptionInterceptor.modifyException(HelpfulUnknownHostExceptionInterceptor.java:59)
        at 
software.amazon.awssdk.core.interceptor.ExecutionInterceptorChain.modifyException(ExecutionInterceptorChain.java:199)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.utils.ExceptionReportingUtils.runModifyException(ExceptionReportingUtils.java:54)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.utils.ExceptionReportingUtils.reportFailureToInterceptors(ExceptionReportingUtils.java:38)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:39)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:26)
        at 
software.amazon.awssdk.core.internal.http.AmazonSyncHttpClient$RequestExecutionBuilderImpl.execute(AmazonSyncHttpClient.java:193)
        at 
software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.invoke(BaseSyncClientHandler.java:103)
        at 
software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.doExecute(BaseSyncClientHandler.java:167)
        at 
software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.lambda$execute$1(BaseSyncClientHandler.java:82)
        at 
software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.measureApiCallSuccess(BaseSyncClientHandler.java:175)
        at 
software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:76)
        at 
software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
        at 
software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:56)
        at 
software.amazon.awssdk.services.sts.DefaultStsClient.getSessionToken(DefaultStsClient.java:1271)
        at 
org.apache.camel.component.aws2.sts.STS2Producer.getSessionToken(STS2Producer.java:153)
        at 
org.apache.camel.component.aws2.sts.STS2Producer.process(STS2Producer.java:58)
        at 
org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
        at 
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:172)
        at 
org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:471)
        at 
org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:193)
        at 
org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:64)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:184)
        at 
org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:398)
        at 
org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:210)
        at 
org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:76)
        at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
        at java.base/java.util.TimerThread.run(Timer.java:506)
Caused by: software.amazon.awssdk.core.exception.SdkClientException: Unable to 
execute HTTP request: vpce-pippo-pluto.sts.eu.central1.vpce.amazonaws.com
        at 
software.amazon.awssdk.core.exception.SdkClientException$BuilderImpl.build(SdkClientException.java:98)
        at 
software.amazon.awssdk.core.exception.SdkClientException.create(SdkClientException.java:43)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.utils.RetryableStageHelper.setLastException(RetryableStageHelper.java:204)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:83)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:36)
        at 
software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
        at 
software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:56)
        at 
software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:36)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.executeWithTimer(ApiCallTimeoutTrackingStage.java:80)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:60)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:42)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:48)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:31)
        at 
software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
        at 
software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:37)
        ... 23 common frames omitted
Caused by: java.net.UnknownHostException: 
vpce-pippo-pluto.sts.eu.central1.vpce.amazonaws.com
        at 
java.base/java.net.InetAddress$CachedAddresses.get(InetAddress.java:797)
        at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1509)
        at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1368)
        at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1302)
        at 
org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
        at 
org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:112)
        at 
org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at 
software.amazon.awssdk.http.apache.internal.conn.ClientConnectionManagerFactory$Handler.invoke(ClientConnectionManagerFactory.java:80)
        at com.sun.proxy.$Proxy64.connect(Unknown Source)
        at 
org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
        at 
org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
        at 
org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
        at 
org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
        at 
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
        at 
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
        at 
software.amazon.awssdk.http.apache.internal.impl.ApacheSdkHttpClient.execute(ApacheSdkHttpClient.java:72)
        at 
software.amazon.awssdk.http.apache.ApacheHttpClient.execute(ApacheHttpClient.java:254)
        at 
software.amazon.awssdk.http.apache.ApacheHttpClient.access$500(ApacheHttpClient.java:107)
        at 
software.amazon.awssdk.http.apache.ApacheHttpClient$1.call(ApacheHttpClient.java:233)
        at 
software.amazon.awssdk.http.apache.ApacheHttpClient$1.call(ApacheHttpClient.java:230)
        at 
software.amazon.awssdk.core.internal.util.MetricUtils.measureDurationUnsafe(MetricUtils.java:64)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.MakeHttpRequestStage.executeHttpRequest(MakeHttpRequestStage.java:77)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.MakeHttpRequestStage.execute(MakeHttpRequestStage.java:56)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.MakeHttpRequestStage.execute(MakeHttpRequestStage.java:39)
        at 
software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
        at 
software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
        at 
software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
        at 
software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptTimeoutTrackingStage.execute(ApiCallAttemptTimeoutTrackingStage.java:73)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptTimeoutTrackingStage.execute(ApiCallAttemptTimeoutTrackingStage.java:42)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage.execute(TimeoutExceptionHandlingStage.java:78)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage.execute(TimeoutExceptionHandlingStage.java:40)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptMetricCollectionStage.execute(ApiCallAttemptMetricCollectionStage.java:50)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptMetricCollectionStage.execute(ApiCallAttemptMetricCollectionStage.java:36)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:81)
        ... 35 common frames omitted

{code}






was (Author: ancosen):
With an xml like this:

{code:xml}
<?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.springboot.example</groupId>
        <artifactId>examples</artifactId>
        <version>3.17.0-SNAPSHOT</version>
    </parent>

    <artifactId>camel-example-spring-boot-aws2-sts</artifactId>
    <name>Camel SB Examples :: AWS2 STS</name>
    <description>An example showing the Camel AWS2 STS component with Spring 
Boot</description>

    <properties>
        <category>Cloud</category>
    </properties>

    <!-- Spring-Boot and Camel BOM -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>2.6.4</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.camel.springboot</groupId>
                <artifactId>camel-spring-boot-bom</artifactId>
                <version>3.14.2</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- Camel -->
        <dependency>
            <groupId>org.apache.camel.springboot</groupId>
            <artifactId>camel-spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel.springboot</groupId>
            <artifactId>camel-aws2-sts-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel.springboot</groupId>
            <artifactId>camel-timer-starter</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.6.4</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>


</project>
{code}

An application.properties like this:


{code:java}
camel.component.aws2-sts.accessKey=xxxx
camel.component.aws2-sts.secretKey=yyyyy
camel.component.aws2-sts.region=eu-central-1
camel.springboot.main-run-controller=true
logging.config=classpath:logback.xml
camel.component.aws2-sts.override-endpoint=true 
camel.component.aws2-sts.uri-endpoint-override=https://vpce-pippo-pluto.sts.eu.central1.vpce.amazonaws.com
{code}

and a route like:


{code:java}
/*
 * 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.example.springboot.aws2sts;

import org.apache.camel.builder.RouteBuilder;
import org.springframework.stereotype.Component;

@Component
public class CamelRoute extends RouteBuilder {

    @Override
    public void configure() throws Exception {

      from("timer://tick?period=1000")
                .to("aws2-sts://label?operation=getSessionToken");
    }
}
{code}

I'm getting the following error:


{code:java}
[INFO] --- spring-boot-maven-plugin:2.6.4:run (default-cli) @ 
camel-example-spring-boot-aws2-sts ---
[INFO] Attaching agents: []

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.6.4)

14:38:40.132 [main           ] INFO  .springboot.aws2s3.Application - Starting 
Application using Java 11.0.15 on ghost with PID 31495 
(/home/oscerd/workspace/apache-camel/camel-spring-boot-examples/aws2-sts/target/classes
 started by oscerd in 
/home/oscerd/workspace/apache-camel/camel-spring-boot-examples/aws2-sts)
14:38:40.133 [main           ] INFO  .springboot.aws2s3.Application - No active 
profile set, falling back to 1 default profile: "default"
14:38:41.242 [main           ] INFO  lSpringBootApplicationListener - Starting 
CamelMainRunController to ensure the main thread keeps running
14:38:41.248 [main           ] INFO  pl.engine.AbstractCamelContext - Routes 
startup (total:1 started:1)
14:38:41.249 [main           ] INFO  pl.engine.AbstractCamelContext -     
Started route1 (timer://tick)
14:38:41.249 [main           ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.14.2 (camel-1) started in 328ms (build:20ms init:75ms start:233ms)
14:38:41.252 [main           ] INFO  .springboot.aws2s3.Application - Started 
Application in 1.316 seconds (JVM running for 1.623)
14:38:52.603 [ - timer://tick] ERROR rorhandler.DefaultErrorHandler - Failed 
delivery for (MessageId: 8C5BB76A269F72A-0000000000000000 on ExchangeId: 
8C5BB76A269F72A-0000000000000000). Exhausted after delivery attempt: 1 caught: 
software.amazon.awssdk.core.exception.SdkClientException: Received an 
UnknownHostException when attempting to interact with a service. See cause for 
the exact endpoint that is failing to resolve. If this is happening on an 
endpoint that previously worked, there may be a network connectivity issue or 
your DNS cache could be storing endpoints for too long.

Message History (complete message history is disabled)
---------------------------------------------------------------------------------------------------------------------------------------
RouteId              ProcessorId          Processor                             
                                           Elapsed (ms)
[route1            ] [route1            ] [from[timer://tick?period=1000]       
                                         ] [     10353]
        ...
[route1            ] [to1               ] 
[aws2-sts://peppe?operation=getSessionToken                                    
] [         0]

Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------

software.amazon.awssdk.core.exception.SdkClientException: Received an 
UnknownHostException when attempting to interact with a service. See cause for 
the exact endpoint that is failing to resolve. If this is happening on an 
endpoint that previously worked, there may be a network connectivity issue or 
your DNS cache could be storing endpoints for too long.
        at 
software.amazon.awssdk.core.exception.SdkClientException$BuilderImpl.build(SdkClientException.java:98)
        at 
software.amazon.awssdk.awscore.interceptor.HelpfulUnknownHostExceptionInterceptor.modifyException(HelpfulUnknownHostExceptionInterceptor.java:59)
        at 
software.amazon.awssdk.core.interceptor.ExecutionInterceptorChain.modifyException(ExecutionInterceptorChain.java:199)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.utils.ExceptionReportingUtils.runModifyException(ExceptionReportingUtils.java:54)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.utils.ExceptionReportingUtils.reportFailureToInterceptors(ExceptionReportingUtils.java:38)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:39)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:26)
        at 
software.amazon.awssdk.core.internal.http.AmazonSyncHttpClient$RequestExecutionBuilderImpl.execute(AmazonSyncHttpClient.java:193)
        at 
software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.invoke(BaseSyncClientHandler.java:103)
        at 
software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.doExecute(BaseSyncClientHandler.java:167)
        at 
software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.lambda$execute$1(BaseSyncClientHandler.java:82)
        at 
software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.measureApiCallSuccess(BaseSyncClientHandler.java:175)
        at 
software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:76)
        at 
software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
        at 
software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:56)
        at 
software.amazon.awssdk.services.sts.DefaultStsClient.getSessionToken(DefaultStsClient.java:1271)
        at 
org.apache.camel.component.aws2.sts.STS2Producer.getSessionToken(STS2Producer.java:153)
        at 
org.apache.camel.component.aws2.sts.STS2Producer.process(STS2Producer.java:58)
        at 
org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
        at 
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:172)
        at 
org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:471)
        at 
org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:193)
        at 
org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:64)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:184)
        at 
org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:398)
        at 
org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:210)
        at 
org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:76)
        at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
        at java.base/java.util.TimerThread.run(Timer.java:506)
Caused by: software.amazon.awssdk.core.exception.SdkClientException: Unable to 
execute HTTP request: vpce-pippo-pluto.sts.eu.central1.vpce.amazonaws.com
        at 
software.amazon.awssdk.core.exception.SdkClientException$BuilderImpl.build(SdkClientException.java:98)
        at 
software.amazon.awssdk.core.exception.SdkClientException.create(SdkClientException.java:43)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.utils.RetryableStageHelper.setLastException(RetryableStageHelper.java:204)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:83)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:36)
        at 
software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
        at 
software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:56)
        at 
software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:36)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.executeWithTimer(ApiCallTimeoutTrackingStage.java:80)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:60)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:42)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:48)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:31)
        at 
software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
        at 
software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
        at 
software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:37)
        ... 23 common frames omitted

{code}





> camel-aws - Unable to override uri-endpoint-override override-endpoint 
> options for STS
> --------------------------------------------------------------------------------------
>
>                 Key: CAMEL-18097
>                 URL: https://issues.apache.org/jira/browse/CAMEL-18097
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-aws, camel-spring-boot
>    Affects Versions: 3.14.2
>            Reporter: Oreste Creolese
>            Assignee: Andrea Cosentino
>            Priority: Minor
>             Fix For: 3.18.0
>
>
> Our goal is to no longer access AWS endpoints via a custom proxy but to 
> access them via VPC endpoints from AWS. To make this work in our secured 
> network we use our own VPC endpoints which we configure with the option: 
> uri-endpoint-override (string) and override-endpoint (boolean). Now the 
> problem is that the options are not used at all and the application always 
> uses the default endpoints which have no access in our network. Because of 
> this the STS component can't execute a HTTP request.
> *And in the console the following error message appears:*
> {code:java}
>  
> Unable to execute HTTP request: Connect to sts.eu-central-1.amazonaws.com:443 
> [sts.eu-central-1.amazonaws.com/54.239.54.207] failed: Connect timed out, 
> ContainerCredentialsProvider(): Cannot fetch credentials from container - 
> neither AWS_CONTAINER_CREDENTIALS_FULL_URI or 
> AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variables are set
> {code}
> As taken from the error message, the default endpoint 
> sts.eu-central-1.amazonaws.com:443 is used.
> *This is how our application.properties looks in which the options are set:*
> {code:java}
> camel.component.aws2-sts.override-endpoint=true 
> camel.component.aws2-sts.uri-endpoint-override=https://vpce-???-???.sts.eu 
> central1.vpce.amazonaws.com{code}
> *We are using the following versions:*
>  * Apache Camel 3.14.2
>  * Spring Boot 2.5.10
> *Dependencies*
> {code:java}
>     <properties>
>     <java.version>14</java.version>
>     <camel.version>3.14.2</camel.version>
>     <spring-boot.version>2.5.10</spring-boot.version>
> </properties>
> <dependencies>
>     <dependency>
>         <groupId>org.springframework.boot</groupId>
>         <artifactId>spring-boot-starter-test</artifactId>
>         <scope>test</scope>
>         <exclusions>
>             <exclusion>
>                 <groupId>org.springframework.boot</groupId>
>                 <artifactId>spring-boot-starter-logging</artifactId>
>             </exclusion>
>         </exclusions>
>     </dependency>
>     
>     <dependency>
>         <groupId>org.apache.camel.springboot</groupId>
>         <artifactId>camel-aws2-s3-starter</artifactId>
>         <exclusions>
>             <exclusion>
>                 <groupId>org.springframework.boot</groupId>
>                 <artifactId>spring-boot-starter-logging</artifactId>
>             </exclusion>
>         </exclusions>
>     </dependency>
>     
>     <dependency>
>         <groupId>org.apache.camel.springboot</groupId>
>         <artifactId>camel-aws2-sts-starter</artifactId>
>         <exclusions>
>             <exclusion>
>                 <groupId>org.springframework.boot</groupId>
>                 <artifactId>spring-boot-starter-logging</artifactId>
>             </exclusion>
>         </exclusions>
>     </dependency>
>     <dependency>
>         <groupId>org.apache.camel</groupId>
>         <artifactId>camel-jetty</artifactId>
>         <version>${camel.version}</version>
>     </dependency>
>     <dependency>
>         <groupId>org.apache.camel</groupId>
>         <artifactId>camel-json-validator</artifactId>
>         <version>${camel.version}</version>
>     </dependency>
> </dependencies>{code}
> *Info* With ticket CAMEL-16171 , Camel added the usage of 
> uri-endpoint-override and override-endpoint options attributes for all AWS 
> components among others for STS.
> Do you have any idea why the options are not overwritten? Thanks a lot for 
> your help!



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to