This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-examples.git
The following commit(s) were added to refs/heads/main by this push:
new 0bf19efb CAMEL-18454: Allow to enable secret refresh from vault. (AWS)
- Align reloading example
0bf19efb is described below
commit 0bf19efb9b174f6a396491de605d5b84a60bba81
Author: Andrea Cosentino <[email protected]>
AuthorDate: Wed Sep 7 15:07:03 2022 +0200
CAMEL-18454: Allow to enable secret refresh from vault. (AWS) - Align
reloading example
Signed-off-by: Andrea Cosentino <[email protected]>
---
.../src/main/java/org/apache/camel/example/MyApplication.java | 7 +------
.../src/main/resources/application.properties | 7 +++----
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git
a/examples/aws/aws-secrets-manager-reloading/src/main/java/org/apache/camel/example/MyApplication.java
b/examples/aws/aws-secrets-manager-reloading/src/main/java/org/apache/camel/example/MyApplication.java
index 6961d638..21f89cd3 100644
---
a/examples/aws/aws-secrets-manager-reloading/src/main/java/org/apache/camel/example/MyApplication.java
+++
b/examples/aws/aws-secrets-manager-reloading/src/main/java/org/apache/camel/example/MyApplication.java
@@ -49,12 +49,7 @@ public final class MyApplication {
Main main = new Main(MyApplication.class);
// now keep the application running until the JVM is terminated (ctrl
+ c or sigterm)
- main.start();
-
- // Task to check for secret updates
- ScheduledExecutorService executor =
Executors.newScheduledThreadPool(1);
- CloudTrailReloadTriggerTask analyzerTask = new
CloudTrailReloadTriggerTask(main.getCamelContext(), "SecretTest");
- executor.scheduleAtFixedRate(analyzerTask, 30, 60, TimeUnit.SECONDS);
+ main.run(args);
}
}
diff --git
a/examples/aws/aws-secrets-manager-reloading/src/main/resources/application.properties
b/examples/aws/aws-secrets-manager-reloading/src/main/resources/application.properties
index e07f7e1d..f8ddb634 100644
---
a/examples/aws/aws-secrets-manager-reloading/src/main/resources/application.properties
+++
b/examples/aws/aws-secrets-manager-reloading/src/main/resources/application.properties
@@ -23,10 +23,9 @@ camel.main.jmx-enabled = false
# extended runtime statistics about bean introspection usage (java reflection)
camel.main.bean-introspection-logging-level=INFO
-# Generic properties
-stock = AMZN
-stockName = Amazon
-
camel.vault.aws.defaultCredentialsProvider=true
camel.vault.aws.region=eu-west-1
+camel.vault.aws.refreshEnabled=true
+camel.vault.aws.refreshPeriod=60000
+camel.vault.aws.secrets=SecretTest
camel.main.context-reload-enabled = true