You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2024/07/29 12:57:30 UTC

(camel-spring-boot) branch main updated (173ab45ecc6 -> c58ff06a061)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git


    from 173ab45ecc6 CAMEL-21022 - Create Camel Langchain4j Web Search Starter (#1186)
     new fca6d1c9c11 CAMEL-21025 - Camel-AWS-Secrets-Manager: Give the ability of refreshing the context on Secrets update by using Eventbridge service instead of pure Cloudtrail - Spring Boot support
     new c58ff06a061 CAMEL-21025 - Camel-AWS-Secrets-Manager: Give the ability of refreshing the context on Secrets update by using Eventbridge service instead of pure Cloudtrail - Spring Boot support

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../springboot/catalog/components/ironmq.json      |  4 ++--
 .../catalog/components/langchain4j-chat.json       |  2 +-
 .../src/main/docs/spring-boot.json                 | 13 +++++++++++
 .../boot/vault/AwsVaultAutoConfiguration.java      |  2 ++
 .../vault/AwsVaultConfigurationProperties.java     | 27 ++++++++++++++++++++++
 .../boot/vault/AwsVaultConfigurationTest.java      |  4 +++-
 6 files changed, 48 insertions(+), 4 deletions(-)


(camel-spring-boot) 01/02: CAMEL-21025 - Camel-AWS-Secrets-Manager: Give the ability of refreshing the context on Secrets update by using Eventbridge service instead of pure Cloudtrail - Spring Boot support

Posted by ac...@apache.org.
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-spring-boot.git

commit fca6d1c9c1169b98c6e5a034177249199c2bd8c8
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Jul 29 14:26:44 2024 +0200

    CAMEL-21025 - Camel-AWS-Secrets-Manager: Give the ability of refreshing the context on Secrets update by using Eventbridge service instead of pure Cloudtrail - Spring Boot support
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../springboot/catalog/components/ironmq.json      |  4 ++--
 .../catalog/components/langchain4j-chat.json       |  2 +-
 .../src/main/docs/spring-boot.json                 | 13 +++++++++++
 .../boot/vault/AwsVaultAutoConfiguration.java      |  2 ++
 .../vault/AwsVaultConfigurationProperties.java     | 27 ++++++++++++++++++++++
 5 files changed, 45 insertions(+), 3 deletions(-)

diff --git a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/ironmq.json b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/ironmq.json
index 4348ef73ea4..5b3a8f65cf4 100644
--- a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/ironmq.json
+++ b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/ironmq.json
@@ -40,9 +40,9 @@
     "ironMQCloud": { "index": 1, "kind": "parameter", "displayName": "Iron MQCloud", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "https:\/\/mq-aws-us-east-1-1.iron.io", "configurationClass": "org.apache.camel.component.ironmq.IronMQConfiguration", "configurationField": "configuration", "description": "IronMq Cloud url. Urls for public clusters: https:\/\/mq-a [...]
     "preserveHeaders": { "index": 2, "kind": "parameter", "displayName": "Preserve Headers", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.ironmq.IronMQConfiguration", "configurationField": "configuration", "description": "Should message headers be preserved when publishing messages. This will add the Camel heade [...]
     "projectId": { "index": 3, "kind": "parameter", "displayName": "Project Id", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ironmq.IronMQConfiguration", "configurationField": "configuration", "description": "IronMQ projectId" },
-    "batchDelete": { "index": 4, "kind": "parameter", "displayName": "Batch Delete", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.ironmq.IronMQConfiguration", "configurationField": "configuration", "description": "Should messages be deleted in one batch. This will limit the number of api requests since [...]
+    "batchDelete": { "index": 4, "kind": "parameter", "displayName": "Batch Delete", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.ironmq.IronMQConfiguration", "configurationField": "configuration", "description": "Should messages be deleted in one batch. This will limit the number of api requests since [...]
     "concurrentConsumers": { "index": 5, "kind": "parameter", "displayName": "Concurrent Consumers", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1, "configurationClass": "org.apache.camel.component.ironmq.IronMQConfiguration", "configurationField": "configuration", "description": "The number of concurrent consumers." },
-    "maxMessagesPerPoll": { "index": 6, "kind": "parameter", "displayName": "Max Messages Per Poll", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1, "configurationClass": "org.apache.camel.component.ironmq.IronMQConfiguration", "configurationField": "configuration", "description": "Number of messages to poll pr. call. Maximum is 100." },
+    "maxMessagesPerPoll": { "index": 6, "kind": "parameter", "displayName": "Max Messages Per Poll", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1, "configurationClass": "org.apache.camel.component.ironmq.IronMQConfiguration", "configurationField": "configuration", "description": "Number of messages to poll per call. Maximum is 100." },
     "sendEmptyMessageWhenIdle": { "index": 7, "kind": "parameter", "displayName": "Send Empty Message When Idle", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead." },
     "timeout": { "index": 8, "kind": "parameter", "displayName": "Timeout", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 60, "configurationClass": "org.apache.camel.component.ironmq.IronMQConfiguration", "configurationField": "configuration", "description": "After timeout (in seconds), item will be placed back onto the queue." },
     "wait": { "index": 9, "kind": "parameter", "displayName": "Wait", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ironmq.IronMQConfiguration", "configurationField": "configuration", "description": "Time in seconds to wait for a message to become available. This enables long polling. Default is 0 (does not wait), maximum is 30." },
diff --git a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/langchain4j-chat.json b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/langchain4j-chat.json
index 17d61af9195..90bb0ccdfe4 100644
--- a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/langchain4j-chat.json
+++ b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/langchain4j-chat.json
@@ -2,7 +2,7 @@
   "component": {
     "kind": "component",
     "name": "langchain4j-chat",
-    "title": "langChain4j Chat",
+    "title": "LangChain4j Chat",
     "description": "LangChain4j Chat component",
     "deprecated": false,
     "firstVersion": "4.5.0",
diff --git a/core/camel-spring-boot/src/main/docs/spring-boot.json b/core/camel-spring-boot/src/main/docs/spring-boot.json
index 3d49fdefe66..dd363f5b4d5 100644
--- a/core/camel-spring-boot/src/main/docs/spring-boot.json
+++ b/core/camel-spring-boot/src/main/docs/spring-boot.json
@@ -1672,6 +1672,19 @@
       "description": "Define the secrets to look at",
       "sourceType": "org.apache.camel.spring.boot.vault.AwsVaultConfigurationProperties"
     },
+    {
+      "name": "camel.vault.aws.sqs-queue-url",
+      "type": "java.lang.String",
+      "description": "In case of usage of SQS notification this field will specified the Queue URL to use",
+      "sourceType": "org.apache.camel.spring.boot.vault.AwsVaultConfigurationProperties"
+    },
+    {
+      "name": "camel.vault.aws.use-sqs-notification",
+      "type": "java.lang.Boolean",
+      "description": "Whether to use AWS SQS for secrets updates notification, this will require setting up Eventbridge\/Cloudtrail\/SQS communication",
+      "sourceType": "org.apache.camel.spring.boot.vault.AwsVaultConfigurationProperties",
+      "defaultValue": false
+    },
     {
       "name": "camel.vault.azure.azure-identity-enabled",
       "type": "java.lang.Boolean",
diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/AwsVaultAutoConfiguration.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/AwsVaultAutoConfiguration.java
index d6fe69c10f1..cb39065122e 100644
--- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/AwsVaultAutoConfiguration.java
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/AwsVaultAutoConfiguration.java
@@ -42,6 +42,8 @@ public class AwsVaultAutoConfiguration {
         answer.setRefreshEnabled(config.isRefreshEnabled());
         answer.setRefreshPeriod(config.getRefreshPeriod());
         answer.setSecrets(config.getSecrets());
+        answer.setUseSqsNotification(config.isUseSqsNotification());
+        answer.setSqsQueueUrl(config.getSqsQueueUrl());
         return answer;
     }
 
diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/AwsVaultConfigurationProperties.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/AwsVaultConfigurationProperties.java
index af46da24bcb..363bdb064f2 100644
--- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/AwsVaultConfigurationProperties.java
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/vault/AwsVaultConfigurationProperties.java
@@ -65,6 +65,17 @@ public class AwsVaultConfigurationProperties {
      * Define the secrets to look at
      */
     private String secrets;
+    
+    /**
+     * Whether to use AWS SQS for secrets updates notification, this will require setting up Eventbridge/Cloudtrail/SQS
+     * communication
+     */
+    private boolean useSqsNotification;
+
+    /**
+     * In case of usage of SQS notification this field will specified the Queue URL to use
+     */
+    private String sqsQueueUrl;
 
     public String getAccessKey() {
         return accessKey;
@@ -137,4 +148,20 @@ public class AwsVaultConfigurationProperties {
     public void setSecrets(String secrets) {
         this.secrets = secrets;
     }
+    
+   public boolean isUseSqsNotification() {
+        return useSqsNotification;
+    }
+
+    public void setUseSqsNotification(boolean useSqsNotification) {
+        this.useSqsNotification = useSqsNotification;
+    }
+
+    public String getSqsQueueUrl() {
+        return sqsQueueUrl;
+    }
+
+    public void setSqsQueueUrl(String sqsQueueUrl) {
+        this.sqsQueueUrl = sqsQueueUrl;
+    }
 }


(camel-spring-boot) 02/02: CAMEL-21025 - Camel-AWS-Secrets-Manager: Give the ability of refreshing the context on Secrets update by using Eventbridge service instead of pure Cloudtrail - Spring Boot support

Posted by ac...@apache.org.
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-spring-boot.git

commit c58ff06a06144fcc73eba12108fc6f03beb323fe
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Jul 29 14:49:28 2024 +0200

    CAMEL-21025 - Camel-AWS-Secrets-Manager: Give the ability of refreshing the context on Secrets update by using Eventbridge service instead of pure Cloudtrail - Spring Boot support
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../org/apache/camel/spring/boot/vault/AwsVaultConfigurationTest.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/AwsVaultConfigurationTest.java b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/AwsVaultConfigurationTest.java
index 3f3d2ea64ac..133d7016d9a 100644
--- a/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/AwsVaultConfigurationTest.java
+++ b/core/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/vault/AwsVaultConfigurationTest.java
@@ -32,7 +32,7 @@ import org.springframework.test.annotation.DirtiesContext;
         "camel.vault.aws.secretKey=mySecretKey", "camel.vault.aws.region=myRegion",
         "camel.vault.aws.defaultCredentialsProvider=false", "camel.vault.aws.refreshPeriod=60000",
         "camel.vault.aws.refreshEnabled=false", "camel.vault.aws.secrets=supersecret",
-        "camel.vault.aws.profile-credentials-provider=true", "camel.vault.aws.profile-name=test" })
+        "camel.vault.aws.profile-credentials-provider=true", "camel.vault.aws.profile-name=test", "camel.vault.aws.use-sqs-notification=true", "camel.vault.aws.sqs-queue-url=http://sqs-2" })
 public class AwsVaultConfigurationTest {
 
     @Autowired
@@ -49,5 +49,7 @@ public class AwsVaultConfigurationTest {
         Assertions.assertEquals("supersecret", camelContext.getVaultConfiguration().aws().getSecrets());
         Assertions.assertEquals("test", camelContext.getVaultConfiguration().aws().getProfileName());
         Assertions.assertEquals(true, camelContext.getVaultConfiguration().aws().isProfileCredentialsProvider());
+        Assertions.assertEquals(true, camelContext.getVaultConfiguration().aws().isUseSqsNotification());
+        Assertions.assertEquals("http://sqs-2", camelContext.getVaultConfiguration().aws().getSqsQueueUrl());
     }
 }