This is an automated email from the ASF dual-hosted git repository.
oscerd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
The following commit(s) were added to refs/heads/main by this push:
new 82187019f chore: Kamelet options must not use a name the kamelet:
component takes, such as location (#3201)
82187019f is described below
commit 82187019fc01c2d1e4e5af8adc832a714ae7f6bf
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Nov 18 15:13:26 2026 +0100
chore: Kamelet options must not use a name the kamelet: component takes,
such as location (#3201)
The kamelet: component keeps some parameters of a kamelet: endpoint for
itself: location is where it loads the Kamelet from, templateId, routeId
and uuid are removed, and block, timeout, failIfNoConsumers,
noErrorHandler, advancedOptions, bridgeErrorHandler, exceptionHandler,
exchangePattern and lazyStartProducer configure the kamelet: endpoint.
A Kamelet option with one of these names never reaches the template
when it is given as a parameter of the kamelet: endpoint.
- google-vertexai-sink: location -> region (required; the Kamelet could
not start with kamelet:google-vertexai-sink?location=...). Mapped to
the location of the google-vertexai component.
- ibm-cos-sink, ibm-cos-source: location -> region. Mapped to the
location of the ibm-cos component, which only shows it in the service
metadata; the region used is the one of endpointUrl.
- fhir-sink, pulsar-sink: lazyStartProducer -> lazyStart. Mapped to the
lazyStartProducer of the fhir and pulsar components.
The catalog validator now fails the build on a Kamelet property with
one of these names, and the developer guide says so.
Co-authored-by: Claude Opus 5.5 <[email protected]>
---
docs/modules/ROOT/pages/development.adoc | 2 ++
.../partials/google-vertexai-sink-description.adoc | 2 +-
.../ROOT/partials/ibm-cos-sink-description.adoc | 10 +++---
.../ROOT/partials/ibm-cos-source-description.adoc | 10 +++---
kamelets/fhir-sink.kamelet.yaml | 6 ++--
kamelets/google-vertexai-sink.kamelet.yaml | 12 +++----
kamelets/ibm-cos-sink.kamelet.yaml | 8 ++---
kamelets/ibm-cos-source.kamelet.yaml | 8 ++---
kamelets/pulsar-sink.kamelet.yaml | 6 ++--
.../main/resources/META-INF/kamelets-index.json | 4 +--
.../main/resources/kamelets/fhir-sink.kamelet.yaml | 6 ++--
.../kamelets/google-vertexai-sink.kamelet.yaml | 12 +++----
.../resources/kamelets/ibm-cos-sink.kamelet.yaml | 8 ++---
.../resources/kamelets/ibm-cos-source.kamelet.yaml | 8 ++---
.../resources/kamelets/pulsar-sink.kamelet.yaml | 6 ++--
.../kamelets/maven/plugin/CatalogValidator.java | 30 ++++++++++++++++++
.../maven/plugin/CatalogValidatorTest.java | 37 ++++++++++++++++++++++
17 files changed, 120 insertions(+), 55 deletions(-)
diff --git a/docs/modules/ROOT/pages/development.adoc
b/docs/modules/ROOT/pages/development.adoc
index 14fb2bd19..82736e8b5 100644
--- a/docs/modules/ROOT/pages/development.adoc
+++ b/docs/modules/ROOT/pages/development.adoc
@@ -949,6 +949,8 @@ spec:
TIP: In other scenarios, you might want to refer to non-required parameters in
the Kamelet's `spec.template` using the `{{?optionalParam}}` syntax; that might
be helpful for those cases where the non-required parameter does not define a
default value in the Kamelet's `spec.definition.properties`. For more
information, you can refer to the using Camel property placeholder syntax in
the Camel Core project documentation.
+IMPORTANT: Do not give a Kamelet parameter the name of an option of the
`kamelet:` component: `templateId`, `routeId`, `location`, `uuid`, `block`,
`timeout`, `failIfNoConsumers`, `noErrorHandler`, `advancedOptions`,
`bridgeErrorHandler`, `exceptionHandler`, `exchangePattern` or
`lazyStartProducer`. In `kamelet:my-sink?location=us-south` the component takes
`location` for itself, as the place to load the Kamelet from, and the template
never sees it; the others configure the `kamelet:` en [...]
+
=== Step 7: add metadata and sugar
We should complete the Kamelet with all mandatory (also optional) options that
are described in https://github.com/apache/camel-kamelets[the guidelines for
contributing Kamelets].
diff --git a/docs/modules/ROOT/partials/google-vertexai-sink-description.adoc
b/docs/modules/ROOT/partials/google-vertexai-sink-description.adoc
index 8c9e1eff0..628954fdf 100644
--- a/docs/modules/ROOT/partials/google-vertexai-sink-description.adoc
+++ b/docs/modules/ROOT/partials/google-vertexai-sink-description.adoc
@@ -9,7 +9,7 @@ If you provide a service account key, give its location:
`file:` followed by the
=== Required Configuration
- **Project ID**: The Google Cloud Project ID
-- **Location**: The Google Cloud region where Vertex AI models are available
(e.g., `us-central1`). When the Kamelet is used from a route as
`kamelet:google-vertexai-sink?location=...`, the `location` is taken as the
place to load the Kamelet from; set it as the property
`camel.kamelet.google-vertexai-sink.location` instead
+- **Region**: The Google Cloud region where Vertex AI models are available
(e.g., `us-central1`), which Vertex AI calls the location
- **Model ID**: The model identifier to use for predictions (e.g.,
`gemini-2.5-pro`)
=== Optional Configuration
diff --git a/docs/modules/ROOT/partials/ibm-cos-sink-description.adoc
b/docs/modules/ROOT/partials/ibm-cos-sink-description.adoc
index 080987d6e..41f74e2d8 100644
--- a/docs/modules/ROOT/partials/ibm-cos-sink-description.adoc
+++ b/docs/modules/ROOT/partials/ibm-cos-sink-description.adoc
@@ -35,7 +35,7 @@ Upload data to an IBM COS bucket:
apiKey: "{{ibm.api.key}}"
serviceInstanceId: "{{ibm.service.instance.id}}"
endpointUrl:
"https://s3.us-south.cloud-object-storage.appdomain.cloud"
- location: "us-south"
+ region: "us-south"
----
==== Auto-creating buckets
@@ -55,7 +55,7 @@ The Kamelet can automatically create the bucket if it doesn't
exist:
apiKey: "{{ibm.api.key}}"
serviceInstanceId: "{{ibm.service.instance.id}}"
endpointUrl:
"https://s3.us-south.cloud-object-storage.appdomain.cloud"
- location: "us-south"
+ region: "us-south"
autoCreateBucket: true
----
@@ -76,7 +76,7 @@ You can specify a fixed key name for all uploaded objects:
apiKey: "{{ibm.api.key}}"
serviceInstanceId: "{{ibm.service.instance.id}}"
endpointUrl:
"https://s3.us-south.cloud-object-storage.appdomain.cloud"
- location: "us-south"
+ region: "us-south"
keyName: "data/myfile.txt"
----
@@ -97,7 +97,7 @@ For large files, you can enable multi-part upload:
apiKey: "{{ibm.api.key}}"
serviceInstanceId: "{{ibm.service.instance.id}}"
endpointUrl:
"https://s3.us-south.cloud-object-storage.appdomain.cloud"
- location: "us-south"
+ region: "us-south"
multiPartUpload: true
partSize: 52428800
----
@@ -121,7 +121,7 @@ You can specify different storage classes for cost
optimization:
apiKey: "{{ibm.api.key}}"
serviceInstanceId: "{{ibm.service.instance.id}}"
endpointUrl:
"https://s3.us-south.cloud-object-storage.appdomain.cloud"
- location: "us-south"
+ region: "us-south"
storageClass: "STANDARD"
----
diff --git a/docs/modules/ROOT/partials/ibm-cos-source-description.adoc
b/docs/modules/ROOT/partials/ibm-cos-source-description.adoc
index a99507231..5325719b8 100644
--- a/docs/modules/ROOT/partials/ibm-cos-source-description.adoc
+++ b/docs/modules/ROOT/partials/ibm-cos-source-description.adoc
@@ -26,7 +26,7 @@ You can consume objects from an IBM COS bucket and delete
them after processing:
apiKey: "{{ibm.api.key}}"
serviceInstanceId: "{{ibm.service.instance.id}}"
endpointUrl: "https://s3.us-south.cloud-object-storage.appdomain.cloud"
- location: "us-south"
+ region: "us-south"
steps:
- to:
uri: "kamelet:log-sink"
@@ -48,7 +48,7 @@ To consume objects without deleting them, set
`deleteAfterRead` to false:
apiKey: "{{ibm.api.key}}"
serviceInstanceId: "{{ibm.service.instance.id}}"
endpointUrl: "https://s3.us-south.cloud-object-storage.appdomain.cloud"
- location: "us-south"
+ region: "us-south"
deleteAfterRead: false
steps:
- to:
@@ -69,7 +69,7 @@ Instead of deleting objects, you can move them to another
bucket:
apiKey: "{{ibm.api.key}}"
serviceInstanceId: "{{ibm.service.instance.id}}"
endpointUrl: "https://s3.us-south.cloud-object-storage.appdomain.cloud"
- location: "us-south"
+ region: "us-south"
deleteAfterRead: false
moveAfterRead: true
destinationBucket: "archive-bucket"
@@ -93,7 +93,7 @@ You can filter objects using a prefix:
apiKey: "{{ibm.api.key}}"
serviceInstanceId: "{{ibm.service.instance.id}}"
endpointUrl: "https://s3.us-south.cloud-object-storage.appdomain.cloud"
- location: "us-south"
+ region: "us-south"
prefix: "inbox/"
steps:
- to:
@@ -116,7 +116,7 @@ To consume only object metadata without the body, set
`includeBody` to false:
apiKey: "{{ibm.api.key}}"
serviceInstanceId: "{{ibm.service.instance.id}}"
endpointUrl: "https://s3.us-south.cloud-object-storage.appdomain.cloud"
- location: "us-south"
+ region: "us-south"
includeBody: false
steps:
- to:
diff --git a/kamelets/fhir-sink.kamelet.yaml b/kamelets/fhir-sink.kamelet.yaml
index a8e829272..33fabbde1 100644
--- a/kamelets/fhir-sink.kamelet.yaml
+++ b/kamelets/fhir-sink.kamelet.yaml
@@ -84,8 +84,8 @@ spec:
description: The base address of the FHIR API of the server, the part
before the resource type, starting with `http://` or `https://`.
type: string
example: "https://fhir.example.com/fhir"
- lazyStartProducer:
- title: Lazy Start Producer
+ lazyStart:
+ title: Lazy Start
description: "If true, the connection to the server is set up at the
first message instead of when the integration starts, so that the integration
can start while the server is not reachable. The first message then takes a
little longer."
type: boolean
default: false
@@ -159,4 +159,4 @@ spec:
prettyPrint: "{{prettyPrint}}"
fhirVersion: "{{fhirVersion}}"
- to:
- uri:
"fhir://{{apiName}}/{{methodName}}?accessToken=RAW({{?accessToken}})&encoding={{encoding}}&fhirVersion={{fhirVersion}}&inBody=resource&lazyStartProducer={{lazyStartProducer}}&log={{log}}&password=RAW({{?password}})&prettyPrint={{prettyPrint}}&proxyHost={{?proxyHost}}&proxyPassword=RAW({{?proxyPassword}})&proxyPort={{?proxyPort}}&proxyUser=RAW({{?proxyUser}})&serverUrl={{serverUrl}}&username=RAW({{?username}})"
+ uri:
"fhir://{{apiName}}/{{methodName}}?accessToken=RAW({{?accessToken}})&encoding={{encoding}}&fhirVersion={{fhirVersion}}&inBody=resource&lazyStartProducer={{lazyStart}}&log={{log}}&password=RAW({{?password}})&prettyPrint={{prettyPrint}}&proxyHost={{?proxyHost}}&proxyPassword=RAW({{?proxyPassword}})&proxyPort={{?proxyPort}}&proxyUser=RAW({{?proxyUser}})&serverUrl={{serverUrl}}&username=RAW({{?username}})"
diff --git a/kamelets/google-vertexai-sink.kamelet.yaml
b/kamelets/google-vertexai-sink.kamelet.yaml
index fb6379ead..a14706e8c 100644
--- a/kamelets/google-vertexai-sink.kamelet.yaml
+++ b/kamelets/google-vertexai-sink.kamelet.yaml
@@ -38,11 +38,9 @@ spec:
Input: the body is the prompt, as text; bytes and streams are read as
text. The optional `CamelGoogleVertexAIPrompt` header gives the prompt instead
of the body.
Output: when it is used inside a route, the body afterwards is the
answer of the model, as text, for the default `generateText` operation. The
`CamelGoogleVertexAIFinishReason` header says why the model stopped, and the
token counts are in the `CamelGoogleVertexAIPromptTokenCount`,
`CamelGoogleVertexAICandidatesTokenCount` and
`CamelGoogleVertexAITotalTokenCount` headers.
-
- Good to know: used from a route as
`kamelet:google-vertexai-sink?location=...`, the `location` option is taken as
the place to load the Kamelet from and the Kamelet fails to start; set it as
the property `camel.kamelet.google-vertexai-sink.location` instead.
required:
- projectId
- - location
+ - region
- modelId
type: object
properties:
@@ -51,9 +49,9 @@ spec:
description: The ID of the Google Cloud project where Vertex AI is
enabled, as shown in the Google Cloud console. It is the project ID, not the
project name or number.
type: string
example: my-project-123
- location:
- title: Google Cloud Location
- description: The Google Cloud region to call the model in, where the
model is available.
+ region:
+ title: Google Cloud Region
+ description: The Google Cloud region to call the model in, where the
model is available. Vertex AI calls it the location.
type: string
example: us-central1
modelId:
@@ -130,7 +128,7 @@ spec:
uri: google-vertexai
parameters:
projectId: "{{projectId}}"
- location: "{{location}}"
+ location: "{{region}}"
modelId: "{{modelId}}"
maxOutputTokens: "{{?maxOutputTokens}}"
operation: "{{operation}}"
diff --git a/kamelets/ibm-cos-sink.kamelet.yaml
b/kamelets/ibm-cos-sink.kamelet.yaml
index c775aadf8..9dd3b3c2f 100644
--- a/kamelets/ibm-cos-sink.kamelet.yaml
+++ b/kamelets/ibm-cos-sink.kamelet.yaml
@@ -72,9 +72,9 @@ spec:
description: The address of Cloud Object Storage for the region of the
bucket, starting with `https://`, as listed under Endpoints in the Cloud Object
Storage instance.
type: string
example: "https://s3.us-south.cloud-object-storage.appdomain.cloud"
- location:
- title: Location
- description: The region of the bucket, such as `us-south` or `eu-gb`.
It is information only; the region used is the one of `endpointUrl`.
+ region:
+ title: Region
+ description: The region of the bucket, such as `us-south` or `eu-gb`.
It is information only, shown with the services the integration calls; the
region used is the one of `endpointUrl`.
type: string
example: "us-south"
autoCreateBucket:
@@ -168,7 +168,7 @@ spec:
autoCreateBucket: "{{autoCreateBucket}}"
endpointUrl: "{{endpointUrl}}"
keyName: "{{?keyName}}"
- location: "{{?location}}"
+ location: "{{?region}}"
multiPartUpload: "{{multiPartUpload}}"
partSize: "{{partSize}}"
serviceInstanceId: "RAW({{serviceInstanceId}})"
diff --git a/kamelets/ibm-cos-source.kamelet.yaml
b/kamelets/ibm-cos-source.kamelet.yaml
index 4967a9a9b..d525a5fd1 100644
--- a/kamelets/ibm-cos-source.kamelet.yaml
+++ b/kamelets/ibm-cos-source.kamelet.yaml
@@ -70,9 +70,9 @@ spec:
description: The address of Cloud Object Storage for the region of the
bucket, starting with `https://`, as listed under Endpoints in the Cloud Object
Storage instance.
type: string
example: "https://s3.us-south.cloud-object-storage.appdomain.cloud"
- location:
- title: Location
- description: The region of the bucket, such as `us-south` or `eu-gb`.
It is information only; the region used is the one of `endpointUrl`.
+ region:
+ title: Region
+ description: The region of the bucket, such as `us-south` or `eu-gb`.
It is information only, shown with the services the integration calls; the
region used is the one of `endpointUrl`.
type: string
example: "us-south"
deleteAfterRead:
@@ -185,7 +185,7 @@ spec:
endpointUrl: "{{endpointUrl}}"
includeBody: "{{includeBody}}"
includeFolders: "{{includeFolders}}"
- location: "{{?location}}"
+ location: "{{?region}}"
maxMessagesPerPoll: "{{maxMessagesPerPoll}}"
moveAfterRead: "{{moveAfterRead}}"
prefix: "{{?prefix}}"
diff --git a/kamelets/pulsar-sink.kamelet.yaml
b/kamelets/pulsar-sink.kamelet.yaml
index a19755f17..e0631f5bb 100644
--- a/kamelets/pulsar-sink.kamelet.yaml
+++ b/kamelets/pulsar-sink.kamelet.yaml
@@ -53,7 +53,7 @@ spec:
Output: the message is unchanged.
- Good to know: it connects with no TLS and no login, unless `serviceUrl`
starts with `pulsar+ssl://` and `authenticationClass` is set. It connects when
the integration starts, and the integration fails to start when Pulsar cannot
be reached, unless `lazyStartProducer` is true.
+ Good to know: it connects with no TLS and no login, unless `serviceUrl`
starts with `pulsar+ssl://` and `authenticationClass` is set. It connects when
the integration starts, and the integration fails to start when Pulsar cannot
be reached, unless `lazyStart` is true.
required:
- topicType
- topic
@@ -126,7 +126,7 @@ spec:
description: "The sequence ID to count from: the first message gets
this number plus one. With the default, -1, the first message gets 0. Pulsar
uses sequence IDs to drop duplicates when deduplication is on."
type: integer
default: -1
- lazyStartProducer:
+ lazyStart:
title: "Lazy Start"
description: "If true, the connection to Pulsar is made when the first
message is sent, not when the integration starts. The integration then starts
even when Pulsar cannot be reached, and the first message takes longer."
type: boolean
@@ -157,4 +157,4 @@ spec:
uri: kamelet:source
steps:
- to:
- uri:
"pulsar:{{topicType}}/{{tenant}}/{{namespaceName}}/{{topic}}?authenticationClass={{?authenticationClass}}&authenticationParams={{?authenticationParams}}&batchingEnabled={{?batchingEnabled}}&batchingMaxMessages={{?batchingMaxMessages}}&batchingMaxPublishDelayMicros={{?batchingMaxPublishDelayMicros}}&blockIfQueueFull={{?blockIfQueueFull}}&compressionType={{?compressionType}}&initialSequenceId={{?initialSequenceId}}&lazyStartProducer={{?lazyStartProducer}}&maxPendingMessage
[...]
+ uri:
"pulsar:{{topicType}}/{{tenant}}/{{namespaceName}}/{{topic}}?authenticationClass={{?authenticationClass}}&authenticationParams={{?authenticationParams}}&batchingEnabled={{?batchingEnabled}}&batchingMaxMessages={{?batchingMaxMessages}}&batchingMaxPublishDelayMicros={{?batchingMaxPublishDelayMicros}}&blockIfQueueFull={{?blockIfQueueFull}}&compressionType={{?compressionType}}&initialSequenceId={{?initialSequenceId}}&lazyStartProducer={{?lazyStart}}&maxPendingMessages={{?max
[...]
diff --git
a/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
b/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
index 3f420bb8c..e4ffb2c59 100644
--- a/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
+++ b/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
@@ -975,7 +975,7 @@
"supportLevel" : "Preview",
"title" : "Google Vertex AI Sink",
"summary" : "Sends each message as a prompt to a generative AI model in
Google Vertex AI, such as Gemini, and replaces the body with the answer of the
model.",
- "description" : "Sends each message as a prompt to a generative AI model
in Google Vertex AI, such as Gemini, and replaces the body with the answer of
the model.\n\nUse it to summarize, classify, translate or answer questions
about text as it flows, for example to summarize support tickets or extract the
topic of an email.\n\nInput: the body is the prompt, as text; bytes and streams
are read as text. The optional `CamelGoogleVertexAIPrompt` header gives the
prompt instead of the body [...]
+ "description" : "Sends each message as a prompt to a generative AI model
in Google Vertex AI, such as Gemini, and replaces the body with the answer of
the model.\n\nUse it to summarize, classify, translate or answer questions
about text as it flows, for example to summarize support tickets or extract the
topic of an email.\n\nInput: the body is the prompt, as text; bytes and streams
are read as text. The optional `CamelGoogleVertexAIPrompt` header gives the
prompt instead of the body [...]
"group" : "Google Vertex AI",
"namespace" : "GCP",
"provider" : "Apache Software Foundation"
@@ -1815,7 +1815,7 @@
"supportLevel" : "Stable",
"title" : "Pulsar Sink",
"summary" : "Sends each message to a topic in Apache Pulsar, named by its
tenant, namespace and topic name.",
- "description" : "Sends each message to a topic in Apache Pulsar, named by
its tenant, namespace and topic name.\n\nUse it to publish events or data for
other applications to read from Pulsar, such as orders or sensor readings. Use
`pulsar-source` to read them.\n\nInput: the body is the payload, as text or
bytes. A Map fails: turn it into JSON text first, for example with
`json-serialize-action`. The headers of the message are not sent as Pulsar
properties; to set properties, put a Ma [...]
+ "description" : "Sends each message to a topic in Apache Pulsar, named by
its tenant, namespace and topic name.\n\nUse it to publish events or data for
other applications to read from Pulsar, such as orders or sensor readings. Use
`pulsar-source` to read them.\n\nInput: the body is the payload, as text or
bytes. A Map fails: turn it into JSON text first, for example with
`json-serialize-action`. The headers of the message are not sent as Pulsar
properties; to set properties, put a Ma [...]
"group" : "Pulsar",
"namespace" : "Messaging",
"provider" : "Apache Software Foundation"
diff --git
a/library/camel-kamelets/src/main/resources/kamelets/fhir-sink.kamelet.yaml
b/library/camel-kamelets/src/main/resources/kamelets/fhir-sink.kamelet.yaml
index a8e829272..33fabbde1 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/fhir-sink.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/fhir-sink.kamelet.yaml
@@ -84,8 +84,8 @@ spec:
description: The base address of the FHIR API of the server, the part
before the resource type, starting with `http://` or `https://`.
type: string
example: "https://fhir.example.com/fhir"
- lazyStartProducer:
- title: Lazy Start Producer
+ lazyStart:
+ title: Lazy Start
description: "If true, the connection to the server is set up at the
first message instead of when the integration starts, so that the integration
can start while the server is not reachable. The first message then takes a
little longer."
type: boolean
default: false
@@ -159,4 +159,4 @@ spec:
prettyPrint: "{{prettyPrint}}"
fhirVersion: "{{fhirVersion}}"
- to:
- uri:
"fhir://{{apiName}}/{{methodName}}?accessToken=RAW({{?accessToken}})&encoding={{encoding}}&fhirVersion={{fhirVersion}}&inBody=resource&lazyStartProducer={{lazyStartProducer}}&log={{log}}&password=RAW({{?password}})&prettyPrint={{prettyPrint}}&proxyHost={{?proxyHost}}&proxyPassword=RAW({{?proxyPassword}})&proxyPort={{?proxyPort}}&proxyUser=RAW({{?proxyUser}})&serverUrl={{serverUrl}}&username=RAW({{?username}})"
+ uri:
"fhir://{{apiName}}/{{methodName}}?accessToken=RAW({{?accessToken}})&encoding={{encoding}}&fhirVersion={{fhirVersion}}&inBody=resource&lazyStartProducer={{lazyStart}}&log={{log}}&password=RAW({{?password}})&prettyPrint={{prettyPrint}}&proxyHost={{?proxyHost}}&proxyPassword=RAW({{?proxyPassword}})&proxyPort={{?proxyPort}}&proxyUser=RAW({{?proxyUser}})&serverUrl={{serverUrl}}&username=RAW({{?username}})"
diff --git
a/library/camel-kamelets/src/main/resources/kamelets/google-vertexai-sink.kamelet.yaml
b/library/camel-kamelets/src/main/resources/kamelets/google-vertexai-sink.kamelet.yaml
index fb6379ead..a14706e8c 100644
---
a/library/camel-kamelets/src/main/resources/kamelets/google-vertexai-sink.kamelet.yaml
+++
b/library/camel-kamelets/src/main/resources/kamelets/google-vertexai-sink.kamelet.yaml
@@ -38,11 +38,9 @@ spec:
Input: the body is the prompt, as text; bytes and streams are read as
text. The optional `CamelGoogleVertexAIPrompt` header gives the prompt instead
of the body.
Output: when it is used inside a route, the body afterwards is the
answer of the model, as text, for the default `generateText` operation. The
`CamelGoogleVertexAIFinishReason` header says why the model stopped, and the
token counts are in the `CamelGoogleVertexAIPromptTokenCount`,
`CamelGoogleVertexAICandidatesTokenCount` and
`CamelGoogleVertexAITotalTokenCount` headers.
-
- Good to know: used from a route as
`kamelet:google-vertexai-sink?location=...`, the `location` option is taken as
the place to load the Kamelet from and the Kamelet fails to start; set it as
the property `camel.kamelet.google-vertexai-sink.location` instead.
required:
- projectId
- - location
+ - region
- modelId
type: object
properties:
@@ -51,9 +49,9 @@ spec:
description: The ID of the Google Cloud project where Vertex AI is
enabled, as shown in the Google Cloud console. It is the project ID, not the
project name or number.
type: string
example: my-project-123
- location:
- title: Google Cloud Location
- description: The Google Cloud region to call the model in, where the
model is available.
+ region:
+ title: Google Cloud Region
+ description: The Google Cloud region to call the model in, where the
model is available. Vertex AI calls it the location.
type: string
example: us-central1
modelId:
@@ -130,7 +128,7 @@ spec:
uri: google-vertexai
parameters:
projectId: "{{projectId}}"
- location: "{{location}}"
+ location: "{{region}}"
modelId: "{{modelId}}"
maxOutputTokens: "{{?maxOutputTokens}}"
operation: "{{operation}}"
diff --git
a/library/camel-kamelets/src/main/resources/kamelets/ibm-cos-sink.kamelet.yaml
b/library/camel-kamelets/src/main/resources/kamelets/ibm-cos-sink.kamelet.yaml
index c775aadf8..9dd3b3c2f 100644
---
a/library/camel-kamelets/src/main/resources/kamelets/ibm-cos-sink.kamelet.yaml
+++
b/library/camel-kamelets/src/main/resources/kamelets/ibm-cos-sink.kamelet.yaml
@@ -72,9 +72,9 @@ spec:
description: The address of Cloud Object Storage for the region of the
bucket, starting with `https://`, as listed under Endpoints in the Cloud Object
Storage instance.
type: string
example: "https://s3.us-south.cloud-object-storage.appdomain.cloud"
- location:
- title: Location
- description: The region of the bucket, such as `us-south` or `eu-gb`.
It is information only; the region used is the one of `endpointUrl`.
+ region:
+ title: Region
+ description: The region of the bucket, such as `us-south` or `eu-gb`.
It is information only, shown with the services the integration calls; the
region used is the one of `endpointUrl`.
type: string
example: "us-south"
autoCreateBucket:
@@ -168,7 +168,7 @@ spec:
autoCreateBucket: "{{autoCreateBucket}}"
endpointUrl: "{{endpointUrl}}"
keyName: "{{?keyName}}"
- location: "{{?location}}"
+ location: "{{?region}}"
multiPartUpload: "{{multiPartUpload}}"
partSize: "{{partSize}}"
serviceInstanceId: "RAW({{serviceInstanceId}})"
diff --git
a/library/camel-kamelets/src/main/resources/kamelets/ibm-cos-source.kamelet.yaml
b/library/camel-kamelets/src/main/resources/kamelets/ibm-cos-source.kamelet.yaml
index 4967a9a9b..d525a5fd1 100644
---
a/library/camel-kamelets/src/main/resources/kamelets/ibm-cos-source.kamelet.yaml
+++
b/library/camel-kamelets/src/main/resources/kamelets/ibm-cos-source.kamelet.yaml
@@ -70,9 +70,9 @@ spec:
description: The address of Cloud Object Storage for the region of the
bucket, starting with `https://`, as listed under Endpoints in the Cloud Object
Storage instance.
type: string
example: "https://s3.us-south.cloud-object-storage.appdomain.cloud"
- location:
- title: Location
- description: The region of the bucket, such as `us-south` or `eu-gb`.
It is information only; the region used is the one of `endpointUrl`.
+ region:
+ title: Region
+ description: The region of the bucket, such as `us-south` or `eu-gb`.
It is information only, shown with the services the integration calls; the
region used is the one of `endpointUrl`.
type: string
example: "us-south"
deleteAfterRead:
@@ -185,7 +185,7 @@ spec:
endpointUrl: "{{endpointUrl}}"
includeBody: "{{includeBody}}"
includeFolders: "{{includeFolders}}"
- location: "{{?location}}"
+ location: "{{?region}}"
maxMessagesPerPoll: "{{maxMessagesPerPoll}}"
moveAfterRead: "{{moveAfterRead}}"
prefix: "{{?prefix}}"
diff --git
a/library/camel-kamelets/src/main/resources/kamelets/pulsar-sink.kamelet.yaml
b/library/camel-kamelets/src/main/resources/kamelets/pulsar-sink.kamelet.yaml
index a19755f17..e0631f5bb 100644
---
a/library/camel-kamelets/src/main/resources/kamelets/pulsar-sink.kamelet.yaml
+++
b/library/camel-kamelets/src/main/resources/kamelets/pulsar-sink.kamelet.yaml
@@ -53,7 +53,7 @@ spec:
Output: the message is unchanged.
- Good to know: it connects with no TLS and no login, unless `serviceUrl`
starts with `pulsar+ssl://` and `authenticationClass` is set. It connects when
the integration starts, and the integration fails to start when Pulsar cannot
be reached, unless `lazyStartProducer` is true.
+ Good to know: it connects with no TLS and no login, unless `serviceUrl`
starts with `pulsar+ssl://` and `authenticationClass` is set. It connects when
the integration starts, and the integration fails to start when Pulsar cannot
be reached, unless `lazyStart` is true.
required:
- topicType
- topic
@@ -126,7 +126,7 @@ spec:
description: "The sequence ID to count from: the first message gets
this number plus one. With the default, -1, the first message gets 0. Pulsar
uses sequence IDs to drop duplicates when deduplication is on."
type: integer
default: -1
- lazyStartProducer:
+ lazyStart:
title: "Lazy Start"
description: "If true, the connection to Pulsar is made when the first
message is sent, not when the integration starts. The integration then starts
even when Pulsar cannot be reached, and the first message takes longer."
type: boolean
@@ -157,4 +157,4 @@ spec:
uri: kamelet:source
steps:
- to:
- uri:
"pulsar:{{topicType}}/{{tenant}}/{{namespaceName}}/{{topic}}?authenticationClass={{?authenticationClass}}&authenticationParams={{?authenticationParams}}&batchingEnabled={{?batchingEnabled}}&batchingMaxMessages={{?batchingMaxMessages}}&batchingMaxPublishDelayMicros={{?batchingMaxPublishDelayMicros}}&blockIfQueueFull={{?blockIfQueueFull}}&compressionType={{?compressionType}}&initialSequenceId={{?initialSequenceId}}&lazyStartProducer={{?lazyStartProducer}}&maxPendingMessage
[...]
+ uri:
"pulsar:{{topicType}}/{{tenant}}/{{namespaceName}}/{{topic}}?authenticationClass={{?authenticationClass}}&authenticationParams={{?authenticationParams}}&batchingEnabled={{?batchingEnabled}}&batchingMaxMessages={{?batchingMaxMessages}}&batchingMaxPublishDelayMicros={{?batchingMaxPublishDelayMicros}}&blockIfQueueFull={{?blockIfQueueFull}}&compressionType={{?compressionType}}&initialSequenceId={{?initialSequenceId}}&lazyStartProducer={{?lazyStart}}&maxPendingMessages={{?max
[...]
diff --git
a/library/kamelets-maven-plugin/src/main/java/org/apache/camel/kamelets/maven/plugin/CatalogValidator.java
b/library/kamelets-maven-plugin/src/main/java/org/apache/camel/kamelets/maven/plugin/CatalogValidator.java
index 2535a2751..eb54b3e2b 100644
---
a/library/kamelets-maven-plugin/src/main/java/org/apache/camel/kamelets/maven/plugin/CatalogValidator.java
+++
b/library/kamelets-maven-plugin/src/main/java/org/apache/camel/kamelets/maven/plugin/CatalogValidator.java
@@ -93,6 +93,16 @@ public final class CatalogValidator {
"cassandra-sink",
"data-type-action");
+ /**
+ * The parameters of a kamelet: endpoint that the kamelet: component takes
for itself (KameletComponent and
+ * KameletEndpoint in apache/camel): templateId, routeId, location and
uuid are removed, and the endpoint options
+ * are bound to the kamelet: endpoint. None of them reaches the template.
+ */
+ static final Set<String> RESERVED_PROPERTY_NAMES = new TreeSet<>(Set.of(
+ "templateId", "routeId", "location", "uuid",
+ "block", "timeout", "failIfNoConsumers", "noErrorHandler",
"advancedOptions",
+ "bridgeErrorHandler", "exceptionHandler", "exchangePattern",
"lazyStartProducer"));
+
private CatalogValidator() {
}
@@ -215,6 +225,7 @@ public final class CatalogValidator {
}
verifyAnnotations(kamelets, errors);
verifyDescriptors(kamelets, errors);
+ verifyReservedPropertyNames(kamelets, errors);
verifyDuplicates(kamelets, errors);
verifySummary(kamelets, errors);
verifyAttributeReferences(kamelets, errors);
@@ -406,6 +417,25 @@ public final class CatalogValidator {
}
}
+ /**
+ * A Kamelet property must not have the name of a parameter that the
kamelet: component takes for itself: such
+ * a parameter of kamelet:my-sink?name=value never reaches the template.
location is where the Kamelet is
+ * loaded from, so the Kamelet is not found at all; the others configure
the kamelet: endpoint instead.
+ */
+ static void verifyReservedPropertyNames(List<KameletInfo> kamelets,
List<String> errors) {
+ for (KameletInfo k : kamelets) {
+ for (String key : k.properties().keySet()) {
+ for (String reserved : RESERVED_PROPERTY_NAMES) {
+ if (reserved.equalsIgnoreCase(key)) {
+ errors.add("property " + q(key) + " in kamelet " +
q(k.name) + " has the name of the "
+ + q(reserved) + " option of the kamelet:
component, which takes it for itself and"
+ + " does not pass it on to the template:
choose another name");
+ }
+ }
+ }
+ }
+ }
+
static void verifyDuplicates(List<KameletInfo> kamelets, List<String>
errors) {
Set<String> titles = new HashSet<>();
Set<String> descriptions = new HashSet<>();
diff --git
a/library/kamelets-maven-plugin/src/test/java/org/apache/camel/kamelets/maven/plugin/CatalogValidatorTest.java
b/library/kamelets-maven-plugin/src/test/java/org/apache/camel/kamelets/maven/plugin/CatalogValidatorTest.java
index cf989f43b..301341ce3 100644
---
a/library/kamelets-maven-plugin/src/test/java/org/apache/camel/kamelets/maven/plugin/CatalogValidatorTest.java
+++
b/library/kamelets-maven-plugin/src/test/java/org/apache/camel/kamelets/maven/plugin/CatalogValidatorTest.java
@@ -18,6 +18,7 @@ package org.apache.camel.kamelets.maven.plugin;
import java.io.File;
import java.util.ArrayList;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -81,6 +82,42 @@ public class CatalogValidatorTest {
"A path such as `/pets/\\{petId}`."));
}
+ @Test
+ void aPropertyNamedLikeAnOptionOfTheKameletComponent() {
+ List<String> errors = verifyReservedPropertyNames("bucketName",
"location");
+
+ assertEquals(List.of("property \"location\" in kamelet \"a-sink\" has
the name of the \"location\" option of the"
+ + " kamelet: component, which takes it for itself and does not
pass it on to the template: choose"
+ + " another name"), errors);
+ }
+
+ @Test
+ void everyOptionOfTheKameletComponentIsReservedWhateverItsCase() {
+ assertEquals(1, verifyReservedPropertyNames("templateId").size());
+ assertEquals(1, verifyReservedPropertyNames("routeId").size());
+ assertEquals(1, verifyReservedPropertyNames("uuid").size());
+ assertEquals(1, verifyReservedPropertyNames("timeout").size());
+ assertEquals(1,
verifyReservedPropertyNames("lazyStartProducer").size());
+ assertEquals(1, verifyReservedPropertyNames("Location").size());
+ }
+
+ @Test
+ void otherPropertyNamesAreFine() {
+ assertEquals(List.of(), verifyReservedPropertyNames("region",
"lazyStart", "connectTimeout", "locationId"));
+ }
+
+ private static List<String> verifyReservedPropertyNames(String... names) {
+ Map<String, Object> properties = new LinkedHashMap<>();
+ for (String name : names) {
+ properties.put(name, Map.of("type", "string", "title", "Option",
"description", "An option."));
+ }
+ Map<String, Object> doc = Map.of("spec", Map.of("definition",
Map.of("properties", properties)));
+ List<String> errors = new ArrayList<>();
+ CatalogValidator.verifyReservedPropertyNames(
+ List.of(new CatalogValidator.KameletInfo("a-sink", new
File("a-sink.kamelet.yaml"), doc)), errors);
+ return errors;
+ }
+
private static List<String> verifyAttributeReferences(String description,
String propertyDescription) {
Map<String, Object> property = Map.of("type", "string", "title",
"Template", "description", propertyDescription);
Map<String, Object> definition = Map.of("title", "A Sink",
"description", description,