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:50:14 UTC
(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
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch CAMEL-21025
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
commit f0e31326279ff7f8048e4fabcd2658db7e2a3583
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;
+ }
}