This is an automated email from the ASF dual-hosted git repository.
davsclaus 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 6baf759ee chore: the options that the Camel fixes of #3280 make
possible (#3285)
6baf759ee is described below
commit 6baf759ee5e9d5ebce48cec07d48b65a339b6dfb
Author: Claus Ibsen <[email protected]>
AuthorDate: Sat Nov 21 00:52:15 2026 +0100
chore: the options that the Camel fixes of #3280 make possible (#3285)
* chore: the options that the Camel fixes of #3280 make possible
- nominatim-geocode-action: language (CAMEL-27200); the answer is in English
when it is not set.
- pulsar-sink: batcherBuilder, DEFAULT or KEY_BASED (CAMEL-27197).
- aws-lambda-sink: invocationType (RequestResponse, Event, DryRun) and
logType
(CAMEL-27178).
- aws-timestream-query-sink: queryAllPages (CAMEL-27179).
- azure-storage-datalake-source: deleteAfterRead (CAMEL-27181).
Each option is passed only when it is set, so nothing changes without it.
New Citrus tests use each option.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* chore: storageClass on google-storage-sink, converse and guardrails on
aws-bedrock-text-sink (#3280)
google-storage-sink: storageClass sets the storage class of the uploaded
files (Camel objectStorageClass, CAMEL-27190/CAMEL-27189).
aws-bedrock-text-sink: operation converse sends the body as the prompt,
as text, and gives the answer as text (CAMEL-27177); guardrailIdentifier,
guardrailVersion and guardrailTrace apply a Bedrock guardrail to it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* chore: azure-storage-blob-source can limit the blobs of one poll with
maxMessagesPerPoll (#3280)
CAMEL-26655 adds maxMessagesPerPoll to camel-azure-storage-blob. The
datalake delete test expects the octet-stream Content-Type that the
binary default gives the consuming route since CAMEL-27258.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y4dDmBDsSWV117kccuNf9
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
---
kamelets/aws-bedrock-text-sink.kamelet.yaml | 36 +++-
kamelets/aws-lambda-sink.kamelet.yaml | 14 +-
kamelets/aws-timestream-query-sink.kamelet.yaml | 10 +-
kamelets/azure-storage-blob-source.kamelet.yaml | 8 +-
.../azure-storage-datalake-source.kamelet.yaml | 7 +-
kamelets/google-storage-sink.kamelet.yaml | 8 +-
kamelets/nominatim-geocode-action.kamelet.yaml | 8 +-
kamelets/pulsar-sink.kamelet.yaml | 7 +-
.../main/resources/META-INF/kamelets-index.json | 12 +-
.../kamelets/aws-bedrock-text-sink.kamelet.yaml | 36 +++-
.../kamelets/aws-lambda-sink.kamelet.yaml | 14 +-
.../aws-timestream-query-sink.kamelet.yaml | 10 +-
.../azure-storage-blob-source.kamelet.yaml | 8 +-
.../azure-storage-datalake-source.kamelet.yaml | 7 +-
.../kamelets/google-storage-sink.kamelet.yaml | 8 +-
.../kamelets/nominatim-geocode-action.kamelet.yaml | 8 +-
.../resources/kamelets/pulsar-sink.kamelet.yaml | 7 +-
...edrock-text-sink-converse-route.citrus.it.yaml} | 30 ++--
.../aws-bedrock-text-sink-converse-route.yaml | 49 ++++++
.../aws-bedrock-text-sink-route.citrus.it.yaml | 2 +-
.../aws-lambda-sink-async-route.citrus.it.yaml} | 61 ++++---
.../aws/lambda/aws-lambda-sink-async-route.yaml | 46 +++++
...tream-query-sink-all-pages-route.citrus.it.yaml | 101 +++++++++++
.../aws-timestream-query-sink-all-pages-route.yaml | 47 ++++++
...-storage-blob-source-limit-route.citrus.it.yaml | 186 +++++++++++++++++++++
.../azure-storage-blob-source-limit-route.yaml | 41 +++++
...age-datalake-source-delete-route.citrus.it.yaml | 133 +++++++++++++++
...azure-storage-datalake-source-delete-route.yaml | 44 +++++
...m-geocode-action-language-route.citrus.it.yaml} | 7 +-
.../nominatim-geocode-action-language-route.yaml | 45 +++++
.../nominatim-geocode-action-route.citrus.it.yaml | 3 +
...storage-sink-storage-class-route.citrus.it.yaml | 105 ++++++++++++
.../google-storage-sink-storage-class-route.yaml | 62 +++++++
.../pulsar-sink-key-based-route.citrus.it.yaml} | 66 ++++----
.../pulsar/pulsar-sink-key-based-route.yaml | 69 ++++++++
35 files changed, 1186 insertions(+), 119 deletions(-)
diff --git a/kamelets/aws-bedrock-text-sink.kamelet.yaml
b/kamelets/aws-bedrock-text-sink.kamelet.yaml
index 09aa27dae..1e295ccae 100644
--- a/kamelets/aws-bedrock-text-sink.kamelet.yaml
+++ b/kamelets/aws-bedrock-text-sink.kamelet.yaml
@@ -37,11 +37,11 @@ spec:
Use it to summarize, classify, translate or write text with a large
language model, for example to summarize support tickets or draft replies. To
answer questions from your own documents in a Bedrock knowledge base, use
`aws-bedrock-agent-runtime-sink`.
- Input: the body is the request of the model, as JSON text in the format
of the chosen model, not the bare prompt, or as a Map, which is written as
JSON. For Amazon Titan, for example `{"inputText":"Summarize:
...","textGenerationConfig":{"maxTokenCount":500}}`. For Claude 3, the Messages
format, for example
`{"anthropic_version":"bedrock-2023-05-31","max_tokens":500,"messages":[{"role":"user","content":"Summarize:
..."}]}`.
+ Input: the body is the request of the model, as JSON text in the format
of the chosen model, not the bare prompt. For Amazon Titan, for example
`{"inputText":"Summarize: ...","textGenerationConfig":{"maxTokenCount":500}}`.
For Claude 3, the Messages format, for example
`{"anthropic_version":"bedrock-2023-05-31","max_tokens":500,"messages":[{"role":"user","content":"Summarize:
..."}]}`. With `operation` set to `converse`, the body is the prompt itself,
as text, such as `Summarize: . [...]
- Output: when it is used inside a route, the body afterwards is the
answer, in a form that depends on the model: for Titan the response as JSON
text, with the generated text in `results`; for Claude 3 the response as parsed
JSON, with the generated text in `content`; for the older Claude models only
the generated text, as text. The `Content-Type` header stays
`application/json`, from the request.
+ Output: when it is used inside a route, the body afterwards is the
answer, in a form that depends on the model: for Titan the response as JSON
text, with the generated text in `results`; for Claude 3 the response as parsed
JSON, with the generated text in `content`; for the older Claude models only
the generated text, as text. With `converse`, the generated text, as text, and
the `CamelAwsBedrockConverseStopReason` header says why the model stopped, such
as `end_turn`, or `guardrai [...]
- Good to know: the request and response formats are those of the model
provider, described for each model in the Amazon Bedrock documentation; a body
in another format fails. Each message is one call of the model. To reach AWS
through an HTTP proxy, set `proxyHost` and `proxyPort`, and set `proxyProtocol`
to `HTTP` for a proxy that takes plain HTTP, such as Squid. Headers that start
with `CamelAwsBedrock` are removed from the message first, so they cannot
change what the Kamelet does.
+ Good to know: with `invokeTextModel`, the request and response formats
are those of the model provider, described for each model in the Amazon Bedrock
documentation; a body in another format fails. A guardrail
(`guardrailIdentifier`) works only with `converse`. Each message is one call of
the model. To reach AWS through an HTTP proxy, set `proxyHost` and `proxyPort`,
and set `proxyProtocol` to `HTTP` for a proxy that takes plain HTTP, such as
Squid. Headers that start with `CamelAw [...]
required:
- modelId
- region
@@ -52,6 +52,26 @@ spec:
description: "The ID of the Bedrock text model to call. The body must
be a request in the format of this model: Amazon Titan (`amazon.titan-text-*`),
AI21 Labs Jurassic (`ai21.j2-*`) or Anthropic Claude (`anthropic.claude-*`)."
type: string
enum: ["amazon.titan-text-express-v1", "amazon.titan-text-lite-v1",
"ai21.j2-ultra-v1", "ai21.j2-mid-v1", "anthropic.claude-instant-v1",
"anthropic.claude-v2", "anthropic.claude-v2:1",
"anthropic.claude-3-sonnet-20240229-v1:0"]
+ operation:
+ title: Operation
+ description: "How the model is called. `invokeTextModel` sends the
body as the request of the model, in the format of its provider. `converse`
sends the body as the prompt, as plain text, with the Converse API of Bedrock,
which works the same way for every model, and gives the answer as text. When it
is not set, it is `invokeTextModel`."
+ type: string
+ enum: ["invokeTextModel", "converse"]
+ default: invokeTextModel
+ guardrailIdentifier:
+ title: Guardrail Identifier
+ description: "The ID or ARN of an Amazon Bedrock guardrail that checks
the prompt and the answer, for example to block a topic or to hide personal
data. Only used when `operation` is `converse`."
+ type: string
+ example: gr-abc123xyz
+ guardrailVersion:
+ title: Guardrail Version
+ description: "The version of the guardrail in `guardrailIdentifier`,
such as `1`. When it is not set, it is `DRAFT`, the working draft of the
guardrail."
+ type: string
+ example: "1"
+ guardrailTrace:
+ title: Guardrail Trace
+ description: "If true, Bedrock reports what the guardrail found, in
the `CamelAwsBedrockGuardrailTrace` header. When it is not set, it is false."
+ type: boolean
accessKey:
title: Access Key
description: "The access key ID of an IAM user, which AWS gives when
you create an access key for the user (in the AWS console: IAM, Users, Security
credentials). Use it together with `secretKey`, or leave both empty and set
`useDefaultCredentialsProvider` or `useProfileCredentialsProvider` instead."
@@ -126,12 +146,13 @@ spec:
enum: ["HTTP", "HTTPS"]
example: HTTP
dataTypes:
+ # No 'default: json' here on purpose: with operation converse the body is
the prompt as
+ # plain text, which the json data type would turn into a quoted JSON
string.
in:
- default: json
types:
json:
format: "application-json"
- description: "The request of the model, as JSON text in bytes."
+ description: "The request of the model for `invokeTextModel`, as
JSON text in the format of the chosen model."
mediaType: application/json
dependencies:
- "camel:jackson3"
@@ -158,8 +179,11 @@ spec:
parameters:
label: bedrock-text
accessKey: "RAW({{?accessKey}})"
+ guardrailIdentifier: "{{?guardrailIdentifier}}"
+ guardrailTrace: "{{?guardrailTrace}}"
+ guardrailVersion: "{{?guardrailVersion}}"
modelId: "{{modelId}}"
- operation: invokeTextModel
+ operation: "{{operation}}"
overrideEndpoint: "{{overrideEndpoint}}"
profileCredentialsName: "{{?profileCredentialsName}}"
region: "{{region}}"
diff --git a/kamelets/aws-lambda-sink.kamelet.yaml
b/kamelets/aws-lambda-sink.kamelet.yaml
index 9033d5016..6d8630db6 100644
--- a/kamelets/aws-lambda-sink.kamelet.yaml
+++ b/kamelets/aws-lambda-sink.kamelet.yaml
@@ -41,7 +41,7 @@ spec:
Output: when it is used inside a route, the body afterwards is what the
function returned, as text (JSON text for most functions). The
`CamelAwsLambdaStatusCode` header holds the status code of the call, and the
`Content-Type` header is `application/json`.
- Good to know: an error raised inside the function does not fail the
message: the body is then the error that the function reported, and the
`CamelAwsLambdaFunctionError` header is set, for example to `Unhandled`. A
function that does not exist fails the message. Each call waits until the
function ends; the function cannot be called asynchronously (invocation type
`Event`). Set `operation` to read the settings, versions or aliases of the
function instead of calling it, or to publish [...]
+ Good to know: an error raised inside the function does not fail the
message: the body is then the error that the function reported, and the
`CamelAwsLambdaFunctionError` header is set, for example to `Unhandled`. A
function that does not exist fails the message. Each call waits until the
function ends, unless `invocationType` is `Event`: the function is then called
asynchronously, and the call answers at once with status code 202 and an empty
body. With `DryRun`, the function is no [...]
required:
- function
- region
@@ -131,6 +131,16 @@ spec:
type: string
example: getFunctionConfiguration
enum: ["invokeFunction", "getFunction", "getFunctionConfiguration",
"listVersions", "listAliases", "publishVersion", "listFunctions"]
+ invocationType:
+ title: Invocation Type
+ description: "How the function is called: `RequestResponse` waits
until the function ends and gives its result; `Event` calls it asynchronously
and answers at once with status code 202 and an empty body; `DryRun` only
checks that the function can be called (status code 204). When not set,
`RequestResponse`."
+ type: string
+ enum: ["RequestResponse", "Event", "DryRun"]
+ logType:
+ title: Log Type
+ description: "Set to `Tail` to get the last 4 KB of the log of a
`RequestResponse` call in the `CamelAwsLambdaLogResult` header, base64-encoded."
+ type: string
+ enum: ["None", "Tail"]
dataTypes:
in:
default: json
@@ -177,3 +187,5 @@ spec:
proxyPort: "{{?proxyPort}}"
proxyProtocol: "{{?proxyProtocol}}"
operation: "{{?operation}}"
+ invocationType: "{{?invocationType}}"
+ logType: "{{?logType}}"
diff --git a/kamelets/aws-timestream-query-sink.kamelet.yaml
b/kamelets/aws-timestream-query-sink.kamelet.yaml
index f8b2c814f..e48b0b2dd 100644
--- a/kamelets/aws-timestream-query-sink.kamelet.yaml
+++ b/kamelets/aws-timestream-query-sink.kamelet.yaml
@@ -39,9 +39,9 @@ spec:
Input: the body is not used. The `query` header (or `ce-query`) is the
SQL query to run, such as `SELECT * FROM "sensors"."readings" WHERE time >
ago(1h)`; it is required.
- Output: when it is used inside a route, the body afterwards is the
answer of AWS, a `QueryResponse` object of the AWS SDK for Java (not JSON
text), with the columns and the rows of the first page of the result.
+ Output: when it is used inside a route, the body afterwards is the
answer of AWS, a `QueryResponse` object of the AWS SDK for Java (not JSON
text), with the columns and the rows of the first page of the result, or of all
of them with `queryAllPages`.
- Good to know: the query is run as it is written in the header, so never
build it from untrusted data. Only the first page of a large result is
returned. To reach AWS through an HTTP proxy, set `proxyHost` and `proxyPort`,
and set `proxyProtocol` to `HTTP` for a proxy that takes plain HTTP, such as
Squid. Headers that start with `CamelAwsTimestream` are removed from the
message first, so they cannot change what the Kamelet does. Amazon Timestream
for LiveAnalytics, the service it qu [...]
+ Good to know: the query is run as it is written in the header, so never
build it from untrusted data. Only the first page of a large result is
returned, unless `queryAllPages` is true, which reads all the pages into one
answer; mind the memory for a very large result. To reach AWS through an HTTP
proxy, set `proxyHost` and `proxyPort`, and set `proxyProtocol` to `HTTP` for a
proxy that takes plain HTTP, such as Squid. Headers that start with
`CamelAwsTimestream` are removed from th [...]
required:
- region
type: object
@@ -119,6 +119,10 @@ spec:
type: string
enum: ["HTTP", "HTTPS"]
example: HTTP
+ queryAllPages:
+ title: Query All Pages
+ description: "If true, all the pages of the result are read, and the
answer holds all the rows. When not set or false, only the first page is
returned."
+ type: boolean
dataTypes:
in:
default: unchanged
@@ -165,4 +169,4 @@ spec:
simple:
expression: "${header[ce-query]}"
- to:
- uri:
"aws2-timestream:query?accessKey=RAW({{?accessKey}})&operation=query&overrideEndpoint={{overrideEndpoint}}&profileCredentialsName={{?profileCredentialsName}}®ion={{region}}&secretKey=RAW({{?secretKey}})&sessionToken=RAW({{?sessionToken}})&uriEndpointOverride={{?uriEndpointOverride}}&useDefaultCredentialsProvider={{useDefaultCredentialsProvider}}&useProfileCredentialsProvider={{useProfileCredentialsProvider}}&useSessionCredentials={{useSessionCredentials}}&proxyHost={{
[...]
+ uri:
"aws2-timestream:query?accessKey=RAW({{?accessKey}})&operation=query&queryAllPages={{?queryAllPages}}&overrideEndpoint={{overrideEndpoint}}&profileCredentialsName={{?profileCredentialsName}}®ion={{region}}&secretKey=RAW({{?secretKey}})&sessionToken=RAW({{?sessionToken}})&uriEndpointOverride={{?uriEndpointOverride}}&useDefaultCredentialsProvider={{useDefaultCredentialsProvider}}&useProfileCredentialsProvider={{useProfileCredentialsProvider}}&useSessionCredentials={{use
[...]
diff --git a/kamelets/azure-storage-blob-source.kamelet.yaml
b/kamelets/azure-storage-blob-source.kamelet.yaml
index 633bfe8ad..c8e0e789f 100644
--- a/kamelets/azure-storage-blob-source.kamelet.yaml
+++ b/kamelets/azure-storage-blob-source.kamelet.yaml
@@ -39,7 +39,7 @@ spec:
Output: the body is the content of the blob, as a stream of bytes, and
the `Content-Type` header is `application/octet-stream`. The headers give the
name of the blob (`CamelAzureStorageBlobBlobName`, with its folder path), its
type, content type, size, ETag and last-modified time.
- Good to know: blobs are kept after they are read, so the same blobs are
read again on every poll, every 500 milliseconds by default; set
`deleteAfterRead` to true to delete each blob once it has been processed, or
`moveAfterRead` to move it to another container. It reads all the blobs of the
container, those in virtual folders too, unless `prefix` or `regex` narrows
them down. With `deleteAfterRead`, the blob deleted is the one named in the
`CamelAzureStorageBlobBlobName` header wh [...]
+ Good to know: blobs are kept after they are read, so the same blobs are
read again on every poll, every 500 milliseconds by default; set
`deleteAfterRead` to true to delete each blob once it has been processed, or
`moveAfterRead` to move it to another container. A poll gets all its blobs
before it sends the first one; to read a large container in smaller polls, set
`maxMessagesPerPoll`. It reads all the blobs of the container, those in virtual
folders too, unless `prefix` or `regex [...]
required:
- accountName
- containerName
@@ -103,6 +103,11 @@ spec:
description: If true, each blob is deleted from the container once it
has been processed. When false, the blobs stay and are read again on every poll.
type: boolean
default: false
+ maxMessagesPerPoll:
+ title: Max Blobs Per Poll
+ description: The most blobs to read in one poll. The next poll goes on
with the blobs after them, and after the last blob of the container it starts
again from the first, so every blob is reached, also when the blobs are kept.
When it is not set, each poll reads all the blobs of the container.
+ type: integer
+ example: 100
prefix:
title: Blob Name Prefix
description: Reads only the blobs whose name starts with this text,
such as `in/` for the blobs in the virtual folder `in` and its subfolders, or
`invoice-`. Ignored when `regex` is set. When neither is set, all the blobs of
the container are read.
@@ -213,6 +218,7 @@ spec:
credentialType: "{{credentialType}}"
sasToken: "RAW({{?sasToken}})"
delay: "{{delay}}"
+ maxMessagesPerPoll: "{{?maxMessagesPerPoll}}"
prefix: "RAW({{?prefix}})"
regex: "RAW({{?regex}})"
moveAfterRead: "{{?moveAfterRead}}"
diff --git a/kamelets/azure-storage-datalake-source.kamelet.yaml
b/kamelets/azure-storage-datalake-source.kamelet.yaml
index e4cf42468..a40252555 100644
--- a/kamelets/azure-storage-datalake-source.kamelet.yaml
+++ b/kamelets/azure-storage-datalake-source.kamelet.yaml
@@ -39,7 +39,7 @@ spec:
Output: the body is the content of the file, as a stream of bytes, and
the `Content-Type` header is `application/octet-stream`. The
`CamelAzureStorageDataLakeFileName` header is the name of the file, and other
headers give its size, content type, ETag and last-modified time.
- Good to know: it neither deletes nor moves the files, so it reads all of
them again on every poll, every 500 milliseconds by default. It reads the files
at the top of the file system, or of `directoryName`; the files in directories
below are read only when `recursive` is true. `regex` keeps only the files
whose path matches, and `fileName` reads one file. Log in as an app
registration with `clientId`, `clientSecret` and `tenantId` (the default), or
with an account key (`accountKey` [...]
+ Good to know: unless `deleteAfterRead` is true, it neither deletes nor
moves the files, so it reads all of them again on every poll, every 500
milliseconds by default. With `deleteAfterRead`, a file is deleted once its
message was handled; a file whose message failed is kept and read again at the
next poll. It reads the files at the top of the file system, or of
`directoryName`; the files in directories below are read only when `recursive`
is true. `regex` keeps only the files whos [...]
required:
- accountName
- fileSystemName
@@ -126,6 +126,10 @@ spec:
type: string
example: exports/sales.csv
pattern: "^[^?#]+$"
+ deleteAfterRead:
+ title: Delete After Read
+ description: "If true, a file is deleted from the file system once its
message was handled, so it is read only once. A file whose message failed is
kept and read again at the next poll. When not set, the files are kept."
+ type: boolean
dataTypes:
out:
default: binary
@@ -284,6 +288,7 @@ spec:
recursive: "{{?recursive}}"
regex: "RAW({{?regex}})"
fileName: "RAW({{?fileName}})"
+ deleteAfterRead: "{{?deleteAfterRead}}"
steps:
- to:
uri: kamelet:sink
diff --git a/kamelets/google-storage-sink.kamelet.yaml
b/kamelets/google-storage-sink.kamelet.yaml
index f2f307970..e12563489 100644
--- a/kamelets/google-storage-sink.kamelet.yaml
+++ b/kamelets/google-storage-sink.kamelet.yaml
@@ -68,6 +68,12 @@ spec:
type: string
example: status/latest.json
pattern: "^[^\\r\\n]+$"
+ storageClass:
+ title: Storage Class
+ description: "The storage class of the uploaded files, which sets what
storing and reading them costs: `STANDARD`, `NEARLINE` (for files read about
once a month), `COLDLINE` (once a quarter) or `ARCHIVE` (once a year). When it
is not set, a file gets the default storage class of the bucket."
+ type: string
+ enum: ["STANDARD", "NEARLINE", "COLDLINE", "ARCHIVE"]
+ example: NEARLINE
storageLocation:
title: Storage Location
description: The location of the bucket that `autoCreateBucket`
creates, such as a region (`europe-west1`) or a multi-region (`EU`). Only used
when the bucket is created. When it is not set, it is `US-EAST1`.
@@ -145,4 +151,4 @@ spec:
simple:
expression: "${exchangeId}"
- to:
- uri:
"google-storage://{{bucketNameOrArn}}?autoCreateBucket={{autoCreateBucket}}&impersonatedServiceAccount={{?impersonatedServiceAccount}}&objectName=RAW({{?objectName}})&serviceAccountKey=RAW(base64:{{?serviceAccountKey}})&storageLocation={{?storageLocation}}&useWorkloadIdentityFederation={{?useWorkloadIdentityFederation}}&workloadIdentityConfig={{?workloadIdentityConfig}}"
+ uri:
"google-storage://{{bucketNameOrArn}}?autoCreateBucket={{autoCreateBucket}}&impersonatedServiceAccount={{?impersonatedServiceAccount}}&objectName=RAW({{?objectName}})&objectStorageClass={{?storageClass}}&serviceAccountKey=RAW(base64:{{?serviceAccountKey}})&storageLocation={{?storageLocation}}&useWorkloadIdentityFederation={{?useWorkloadIdentityFederation}}&workloadIdentityConfig={{?workloadIdentityConfig}}"
diff --git a/kamelets/nominatim-geocode-action.kamelet.yaml
b/kamelets/nominatim-geocode-action.kamelet.yaml
index fbbd5e7b9..3b6474b9f 100644
--- a/kamelets/nominatim-geocode-action.kamelet.yaml
+++ b/kamelets/nominatim-geocode-action.kamelet.yaml
@@ -40,7 +40,7 @@ spec:
Output: the body is JSON text, as bytes, with `Content-Type:
application/json`: an array with the best match, with its coordinates, its full
address and its kind of place, or an empty array when nothing matches. The
headers give the same answer in short: `CamelGeoCoderLat` and
`CamelGeoCoderLng` (the coordinates), `CamelGeoCoderAddress` (the full address
found), `CamelGeoCoderCity`, `CamelGeoCoderCountryLong`,
`CamelGeoCoderPostalCode` and `CamelGeoCoderStatus`, which is `OK` when [...]
- Good to know: a place that is not found does not fail the message; check
`CamelGeoCoderStatus`. The public server `https://nominatim.openstreetmap.org`
limits how often it may be called; for many lookups, run your own Nominatim
server. Headers that start with `CamelGeoCoder` are removed from the message
first, so they cannot change what the Kamelet does.
+ Good to know: a place that is not found does not fail the message; check
`CamelGeoCoderStatus`. The address, the city and the country are in English,
unless `language` asks for another language. The public server
`https://nominatim.openstreetmap.org` limits how often it may be called; for
many lookups, run your own Nominatim server. Headers that start with
`CamelGeoCoder` are removed from the message first, so they cannot change what
the Kamelet does.
required:
- serverUrl
type: object
@@ -50,6 +50,11 @@ spec:
description: "The address of the Nominatim server, starting with
`https://`, without a path. Use the public OpenStreetMap server for a few
lookups, or your own server."
example: "https://nominatim.openstreetmap.org"
type: string
+ language:
+ title: Language
+ description: "The language of the answer, such as of the address, the
city and the country, as a language code such as `en`, `de` or `fr`. It is sent
to Nominatim as `accept-language`. When not set, the answer is in English."
+ type: string
+ example: de
dataTypes:
in:
default: text
@@ -154,6 +159,7 @@ spec:
address: address
latlng: toOverride
serverUrl: "RAW({{serverUrl}})"
+ language: "{{?language}}"
type: NOMINATIM
- marshal:
json: {}
diff --git a/kamelets/pulsar-sink.kamelet.yaml
b/kamelets/pulsar-sink.kamelet.yaml
index 6108718fc..ab5820c73 100644
--- a/kamelets/pulsar-sink.kamelet.yaml
+++ b/kamelets/pulsar-sink.kamelet.yaml
@@ -167,6 +167,11 @@ spec:
description: "How long Pulsar may take to confirm a message before the
message fails, in milliseconds. For example, 30000 is 30 seconds."
type: integer
default: 30000
+ batcherBuilder:
+ title: Batcher
+ description: "How the messages are put in batches, when
`batchingEnabled` is true: `DEFAULT` batches the messages together whatever
their key; `KEY_BASED` batches the messages of each key separately, so that a
`Key_Shared` subscription spreads the keys over its consumers. When not set,
`DEFAULT`."
+ type: string
+ enum: ["DEFAULT", "KEY_BASED"]
type: object
template:
from:
@@ -187,4 +192,4 @@ spec:
simple:
expression: "${header[key]}"
- to:
- 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
[...]
+ uri:
"pulsar:{{topicType}}/{{tenant}}/{{namespaceName}}/{{topic}}?authenticationClass={{?authenticationClass}}&authenticationParams={{?authenticationParams}}&batcherBuilder={{?batcherBuilder}}&batchingEnabled={{?batchingEnabled}}&batchingMaxMessages={{?batchingMaxMessages}}&batchingMaxPublishDelayMicros={{?batchingMaxPublishDelayMicros}}&blockIfQueueFull={{?blockIfQueueFull}}&compressionType={{?compressionType}}&initialSequenceId={{?initialSequenceId}}&lazyStartProducer={{?la
[...]
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 a124ca769..d40564a46 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
@@ -45,7 +45,7 @@
"supportLevel" : "Stable",
"title" : "AWS Bedrock Text Sink",
"summary" : "Sends a prompt to a text model in Amazon Bedrock, such as
Amazon Titan or Anthropic Claude, for each message, and gives the answer of the
model.",
- "description" : "Sends a prompt to a text model in Amazon Bedrock, such as
Amazon Titan or Anthropic Claude, for each message, and gives the answer of the
model.\n\nUse it to summarize, classify, translate or write text with a large
language model, for example to summarize support tickets or draft replies. To
answer questions from your own documents in a Bedrock knowledge base, use
`aws-bedrock-agent-runtime-sink`.\n\nInput: the body is the request of the
model, as JSON text in the f [...]
+ "description" : "Sends a prompt to a text model in Amazon Bedrock, such as
Amazon Titan or Anthropic Claude, for each message, and gives the answer of the
model.\n\nUse it to summarize, classify, translate or write text with a large
language model, for example to summarize support tickets or draft replies. To
answer questions from your own documents in a Bedrock knowledge base, use
`aws-bedrock-agent-runtime-sink`.\n\nInput: the body is the request of the
model, as JSON text in the f [...]
"group" : "AWS Bedrock",
"namespace" : "AWS",
"provider" : "Apache Software Foundation"
@@ -155,7 +155,7 @@
"supportLevel" : "Stable",
"title" : "AWS Lambda Sink",
"summary" : "Calls an AWS Lambda function for each message, with the body
as the event of the function, and waits for its result.",
- "description" : "Calls an AWS Lambda function for each message, with the
body as the event of the function, and waits for its result.\n\nUse it to run
your own serverless code on each message, such as enriching an order, checking
a document or calling another API, without running a server for it.\n\nInput:
the body is the event given to the function, as JSON text, such as
`{\"orderId\":\"A-1\"}`, or as a Map or a List, which is written as JSON. Other
text is sent as a JSON string: `h [...]
+ "description" : "Calls an AWS Lambda function for each message, with the
body as the event of the function, and waits for its result.\n\nUse it to run
your own serverless code on each message, such as enriching an order, checking
a document or calling another API, without running a server for it.\n\nInput:
the body is the event given to the function, as JSON text, such as
`{\"orderId\":\"A-1\"}`, or as a Map or a List, which is written as JSON. Other
text is sent as a JSON string: `h [...]
"group" : "AWS Lambda",
"namespace" : "AWS",
"provider" : "Apache Software Foundation"
@@ -315,7 +315,7 @@
"supportLevel" : "Preview",
"title" : "AWS Timestream Query Sink",
"summary" : "Runs an SQL query on Amazon Timestream, the time series
database of AWS, for each message, with the query taken from a header.",
- "description" : "Runs an SQL query on Amazon Timestream, the time series
database of AWS, for each message, with the query taken from a header.\n\nUse
it to read time series data, such as sensor readings or application metrics,
for example every hour from `timer-source`, to build a report or check a
threshold.\n\nInput: the body is not used. The `query` header (or `ce-query`)
is the SQL query to run, such as `SELECT * FROM \"sensors\".\"readings\" WHERE
time > ago(1h)`; it is require [...]
+ "description" : "Runs an SQL query on Amazon Timestream, the time series
database of AWS, for each message, with the query taken from a header.\n\nUse
it to read time series data, such as sensor readings or application metrics,
for example every hour from `timer-source`, to build a report or check a
threshold.\n\nInput: the body is not used. The `query` header (or `ce-query`)
is the SQL query to run, such as `SELECT * FROM \"sensors\".\"readings\" WHERE
time > ago(1h)`; it is require [...]
"group" : "AWS Timestream",
"namespace" : "AWS",
"provider" : "Apache Software Foundation"
@@ -435,7 +435,7 @@
"supportLevel" : "Stable",
"title" : "Azure Storage Blob Source",
"summary" : "Reads the files (blobs) in a container of Azure Blob Storage,
one message per blob, and can delete each blob, or move it to another
container, once it has been read.",
- "description" : "Reads the files (blobs) in a container of Azure Blob
Storage, one message per blob, and can delete each blob, or move it to another
container, once it has been read.\n\nUse it to process files that another
system drops into a container, such as uploaded documents, exported reports or
log files. To react to new blobs through Event Grid events instead of reading
the container over and over, use
`azure-storage-blob-event-based-source`.\n\nOutput: the body is the content
[...]
+ "description" : "Reads the files (blobs) in a container of Azure Blob
Storage, one message per blob, and can delete each blob, or move it to another
container, once it has been read.\n\nUse it to process files that another
system drops into a container, such as uploaded documents, exported reports or
log files. To react to new blobs through Event Grid events instead of reading
the container over and over, use
`azure-storage-blob-event-based-source`.\n\nOutput: the body is the content
[...]
"group" : "Azure Storage Blob",
"namespace" : "Azure",
"provider" : "Apache Software Foundation"
@@ -455,7 +455,7 @@
"supportLevel" : "Stable",
"title" : "Azure Storage Blob Data Lake Source",
"summary" : "Reads the files in a file system of Azure Data Lake Storage
Gen2, one message per file, on every poll.",
- "description" : "Reads the files in a file system of Azure Data Lake
Storage Gen2, one message per file, on every poll.\n\nUse it to process files
that land in a data lake, such as exports or reports. For plain blob
containers, use `azure-storage-blob-source`, which can also delete what it
reads.\n\nOutput: the body is the content of the file, as a stream of bytes,
and the `Content-Type` header is `application/octet-stream`. The
`CamelAzureStorageDataLakeFileName` header is the name [...]
+ "description" : "Reads the files in a file system of Azure Data Lake
Storage Gen2, one message per file, on every poll.\n\nUse it to process files
that land in a data lake, such as exports or reports. For plain blob
containers, use `azure-storage-blob-source`, which can also delete what it
reads.\n\nOutput: the body is the content of the file, as a stream of bytes,
and the `Content-Type` header is `application/octet-stream`. The
`CamelAzureStorageDataLakeFileName` header is the name [...]
"group" : "Azure Storage Blob Data Lake",
"namespace" : "Azure",
"provider" : "Apache Software Foundation"
@@ -1565,7 +1565,7 @@
"supportLevel" : "Stable",
"title" : "Nominatim GeoCode Action",
"summary" : "Looks up a place name or a postal address, such as `Eiffel
Tower, Paris`, in a Nominatim server of OpenStreetMap, and gives the best match
with its coordinates as JSON.",
- "description" : "Looks up a place name or a postal address, such as
`Eiffel Tower, Paris`, in a Nominatim server of OpenStreetMap, and gives the
best match with its coordinates as JSON.\n\nUse it to turn the addresses in
orders, customer records or events into latitude and longitude, for example to
show them on a map or to find the nearest store.\n\nInput: the place name or
address to look up, as text.\n\nOutput: the body is JSON text, as bytes, with
`Content-Type: application/json`: [...]
+ "description" : "Looks up a place name or a postal address, such as
`Eiffel Tower, Paris`, in a Nominatim server of OpenStreetMap, and gives the
best match with its coordinates as JSON.\n\nUse it to turn the addresses in
orders, customer records or events into latitude and longitude, for example to
show them on a map or to find the nearest store.\n\nInput: the place name or
address to look up, as text.\n\nOutput: the body is JSON text, as bytes, with
`Content-Type: application/json`: [...]
"group" : "Geospatial",
"namespace" : "Geo",
"provider" : "Apache Software Foundation"
diff --git
a/library/camel-kamelets/src/main/resources/kamelets/aws-bedrock-text-sink.kamelet.yaml
b/library/camel-kamelets/src/main/resources/kamelets/aws-bedrock-text-sink.kamelet.yaml
index 09aa27dae..1e295ccae 100644
---
a/library/camel-kamelets/src/main/resources/kamelets/aws-bedrock-text-sink.kamelet.yaml
+++
b/library/camel-kamelets/src/main/resources/kamelets/aws-bedrock-text-sink.kamelet.yaml
@@ -37,11 +37,11 @@ spec:
Use it to summarize, classify, translate or write text with a large
language model, for example to summarize support tickets or draft replies. To
answer questions from your own documents in a Bedrock knowledge base, use
`aws-bedrock-agent-runtime-sink`.
- Input: the body is the request of the model, as JSON text in the format
of the chosen model, not the bare prompt, or as a Map, which is written as
JSON. For Amazon Titan, for example `{"inputText":"Summarize:
...","textGenerationConfig":{"maxTokenCount":500}}`. For Claude 3, the Messages
format, for example
`{"anthropic_version":"bedrock-2023-05-31","max_tokens":500,"messages":[{"role":"user","content":"Summarize:
..."}]}`.
+ Input: the body is the request of the model, as JSON text in the format
of the chosen model, not the bare prompt. For Amazon Titan, for example
`{"inputText":"Summarize: ...","textGenerationConfig":{"maxTokenCount":500}}`.
For Claude 3, the Messages format, for example
`{"anthropic_version":"bedrock-2023-05-31","max_tokens":500,"messages":[{"role":"user","content":"Summarize:
..."}]}`. With `operation` set to `converse`, the body is the prompt itself,
as text, such as `Summarize: . [...]
- Output: when it is used inside a route, the body afterwards is the
answer, in a form that depends on the model: for Titan the response as JSON
text, with the generated text in `results`; for Claude 3 the response as parsed
JSON, with the generated text in `content`; for the older Claude models only
the generated text, as text. The `Content-Type` header stays
`application/json`, from the request.
+ Output: when it is used inside a route, the body afterwards is the
answer, in a form that depends on the model: for Titan the response as JSON
text, with the generated text in `results`; for Claude 3 the response as parsed
JSON, with the generated text in `content`; for the older Claude models only
the generated text, as text. With `converse`, the generated text, as text, and
the `CamelAwsBedrockConverseStopReason` header says why the model stopped, such
as `end_turn`, or `guardrai [...]
- Good to know: the request and response formats are those of the model
provider, described for each model in the Amazon Bedrock documentation; a body
in another format fails. Each message is one call of the model. To reach AWS
through an HTTP proxy, set `proxyHost` and `proxyPort`, and set `proxyProtocol`
to `HTTP` for a proxy that takes plain HTTP, such as Squid. Headers that start
with `CamelAwsBedrock` are removed from the message first, so they cannot
change what the Kamelet does.
+ Good to know: with `invokeTextModel`, the request and response formats
are those of the model provider, described for each model in the Amazon Bedrock
documentation; a body in another format fails. A guardrail
(`guardrailIdentifier`) works only with `converse`. Each message is one call of
the model. To reach AWS through an HTTP proxy, set `proxyHost` and `proxyPort`,
and set `proxyProtocol` to `HTTP` for a proxy that takes plain HTTP, such as
Squid. Headers that start with `CamelAw [...]
required:
- modelId
- region
@@ -52,6 +52,26 @@ spec:
description: "The ID of the Bedrock text model to call. The body must
be a request in the format of this model: Amazon Titan (`amazon.titan-text-*`),
AI21 Labs Jurassic (`ai21.j2-*`) or Anthropic Claude (`anthropic.claude-*`)."
type: string
enum: ["amazon.titan-text-express-v1", "amazon.titan-text-lite-v1",
"ai21.j2-ultra-v1", "ai21.j2-mid-v1", "anthropic.claude-instant-v1",
"anthropic.claude-v2", "anthropic.claude-v2:1",
"anthropic.claude-3-sonnet-20240229-v1:0"]
+ operation:
+ title: Operation
+ description: "How the model is called. `invokeTextModel` sends the
body as the request of the model, in the format of its provider. `converse`
sends the body as the prompt, as plain text, with the Converse API of Bedrock,
which works the same way for every model, and gives the answer as text. When it
is not set, it is `invokeTextModel`."
+ type: string
+ enum: ["invokeTextModel", "converse"]
+ default: invokeTextModel
+ guardrailIdentifier:
+ title: Guardrail Identifier
+ description: "The ID or ARN of an Amazon Bedrock guardrail that checks
the prompt and the answer, for example to block a topic or to hide personal
data. Only used when `operation` is `converse`."
+ type: string
+ example: gr-abc123xyz
+ guardrailVersion:
+ title: Guardrail Version
+ description: "The version of the guardrail in `guardrailIdentifier`,
such as `1`. When it is not set, it is `DRAFT`, the working draft of the
guardrail."
+ type: string
+ example: "1"
+ guardrailTrace:
+ title: Guardrail Trace
+ description: "If true, Bedrock reports what the guardrail found, in
the `CamelAwsBedrockGuardrailTrace` header. When it is not set, it is false."
+ type: boolean
accessKey:
title: Access Key
description: "The access key ID of an IAM user, which AWS gives when
you create an access key for the user (in the AWS console: IAM, Users, Security
credentials). Use it together with `secretKey`, or leave both empty and set
`useDefaultCredentialsProvider` or `useProfileCredentialsProvider` instead."
@@ -126,12 +146,13 @@ spec:
enum: ["HTTP", "HTTPS"]
example: HTTP
dataTypes:
+ # No 'default: json' here on purpose: with operation converse the body is
the prompt as
+ # plain text, which the json data type would turn into a quoted JSON
string.
in:
- default: json
types:
json:
format: "application-json"
- description: "The request of the model, as JSON text in bytes."
+ description: "The request of the model for `invokeTextModel`, as
JSON text in the format of the chosen model."
mediaType: application/json
dependencies:
- "camel:jackson3"
@@ -158,8 +179,11 @@ spec:
parameters:
label: bedrock-text
accessKey: "RAW({{?accessKey}})"
+ guardrailIdentifier: "{{?guardrailIdentifier}}"
+ guardrailTrace: "{{?guardrailTrace}}"
+ guardrailVersion: "{{?guardrailVersion}}"
modelId: "{{modelId}}"
- operation: invokeTextModel
+ operation: "{{operation}}"
overrideEndpoint: "{{overrideEndpoint}}"
profileCredentialsName: "{{?profileCredentialsName}}"
region: "{{region}}"
diff --git
a/library/camel-kamelets/src/main/resources/kamelets/aws-lambda-sink.kamelet.yaml
b/library/camel-kamelets/src/main/resources/kamelets/aws-lambda-sink.kamelet.yaml
index 9033d5016..6d8630db6 100644
---
a/library/camel-kamelets/src/main/resources/kamelets/aws-lambda-sink.kamelet.yaml
+++
b/library/camel-kamelets/src/main/resources/kamelets/aws-lambda-sink.kamelet.yaml
@@ -41,7 +41,7 @@ spec:
Output: when it is used inside a route, the body afterwards is what the
function returned, as text (JSON text for most functions). The
`CamelAwsLambdaStatusCode` header holds the status code of the call, and the
`Content-Type` header is `application/json`.
- Good to know: an error raised inside the function does not fail the
message: the body is then the error that the function reported, and the
`CamelAwsLambdaFunctionError` header is set, for example to `Unhandled`. A
function that does not exist fails the message. Each call waits until the
function ends; the function cannot be called asynchronously (invocation type
`Event`). Set `operation` to read the settings, versions or aliases of the
function instead of calling it, or to publish [...]
+ Good to know: an error raised inside the function does not fail the
message: the body is then the error that the function reported, and the
`CamelAwsLambdaFunctionError` header is set, for example to `Unhandled`. A
function that does not exist fails the message. Each call waits until the
function ends, unless `invocationType` is `Event`: the function is then called
asynchronously, and the call answers at once with status code 202 and an empty
body. With `DryRun`, the function is no [...]
required:
- function
- region
@@ -131,6 +131,16 @@ spec:
type: string
example: getFunctionConfiguration
enum: ["invokeFunction", "getFunction", "getFunctionConfiguration",
"listVersions", "listAliases", "publishVersion", "listFunctions"]
+ invocationType:
+ title: Invocation Type
+ description: "How the function is called: `RequestResponse` waits
until the function ends and gives its result; `Event` calls it asynchronously
and answers at once with status code 202 and an empty body; `DryRun` only
checks that the function can be called (status code 204). When not set,
`RequestResponse`."
+ type: string
+ enum: ["RequestResponse", "Event", "DryRun"]
+ logType:
+ title: Log Type
+ description: "Set to `Tail` to get the last 4 KB of the log of a
`RequestResponse` call in the `CamelAwsLambdaLogResult` header, base64-encoded."
+ type: string
+ enum: ["None", "Tail"]
dataTypes:
in:
default: json
@@ -177,3 +187,5 @@ spec:
proxyPort: "{{?proxyPort}}"
proxyProtocol: "{{?proxyProtocol}}"
operation: "{{?operation}}"
+ invocationType: "{{?invocationType}}"
+ logType: "{{?logType}}"
diff --git
a/library/camel-kamelets/src/main/resources/kamelets/aws-timestream-query-sink.kamelet.yaml
b/library/camel-kamelets/src/main/resources/kamelets/aws-timestream-query-sink.kamelet.yaml
index f8b2c814f..e48b0b2dd 100644
---
a/library/camel-kamelets/src/main/resources/kamelets/aws-timestream-query-sink.kamelet.yaml
+++
b/library/camel-kamelets/src/main/resources/kamelets/aws-timestream-query-sink.kamelet.yaml
@@ -39,9 +39,9 @@ spec:
Input: the body is not used. The `query` header (or `ce-query`) is the
SQL query to run, such as `SELECT * FROM "sensors"."readings" WHERE time >
ago(1h)`; it is required.
- Output: when it is used inside a route, the body afterwards is the
answer of AWS, a `QueryResponse` object of the AWS SDK for Java (not JSON
text), with the columns and the rows of the first page of the result.
+ Output: when it is used inside a route, the body afterwards is the
answer of AWS, a `QueryResponse` object of the AWS SDK for Java (not JSON
text), with the columns and the rows of the first page of the result, or of all
of them with `queryAllPages`.
- Good to know: the query is run as it is written in the header, so never
build it from untrusted data. Only the first page of a large result is
returned. To reach AWS through an HTTP proxy, set `proxyHost` and `proxyPort`,
and set `proxyProtocol` to `HTTP` for a proxy that takes plain HTTP, such as
Squid. Headers that start with `CamelAwsTimestream` are removed from the
message first, so they cannot change what the Kamelet does. Amazon Timestream
for LiveAnalytics, the service it qu [...]
+ Good to know: the query is run as it is written in the header, so never
build it from untrusted data. Only the first page of a large result is
returned, unless `queryAllPages` is true, which reads all the pages into one
answer; mind the memory for a very large result. To reach AWS through an HTTP
proxy, set `proxyHost` and `proxyPort`, and set `proxyProtocol` to `HTTP` for a
proxy that takes plain HTTP, such as Squid. Headers that start with
`CamelAwsTimestream` are removed from th [...]
required:
- region
type: object
@@ -119,6 +119,10 @@ spec:
type: string
enum: ["HTTP", "HTTPS"]
example: HTTP
+ queryAllPages:
+ title: Query All Pages
+ description: "If true, all the pages of the result are read, and the
answer holds all the rows. When not set or false, only the first page is
returned."
+ type: boolean
dataTypes:
in:
default: unchanged
@@ -165,4 +169,4 @@ spec:
simple:
expression: "${header[ce-query]}"
- to:
- uri:
"aws2-timestream:query?accessKey=RAW({{?accessKey}})&operation=query&overrideEndpoint={{overrideEndpoint}}&profileCredentialsName={{?profileCredentialsName}}®ion={{region}}&secretKey=RAW({{?secretKey}})&sessionToken=RAW({{?sessionToken}})&uriEndpointOverride={{?uriEndpointOverride}}&useDefaultCredentialsProvider={{useDefaultCredentialsProvider}}&useProfileCredentialsProvider={{useProfileCredentialsProvider}}&useSessionCredentials={{useSessionCredentials}}&proxyHost={{
[...]
+ uri:
"aws2-timestream:query?accessKey=RAW({{?accessKey}})&operation=query&queryAllPages={{?queryAllPages}}&overrideEndpoint={{overrideEndpoint}}&profileCredentialsName={{?profileCredentialsName}}®ion={{region}}&secretKey=RAW({{?secretKey}})&sessionToken=RAW({{?sessionToken}})&uriEndpointOverride={{?uriEndpointOverride}}&useDefaultCredentialsProvider={{useDefaultCredentialsProvider}}&useProfileCredentialsProvider={{useProfileCredentialsProvider}}&useSessionCredentials={{use
[...]
diff --git
a/library/camel-kamelets/src/main/resources/kamelets/azure-storage-blob-source.kamelet.yaml
b/library/camel-kamelets/src/main/resources/kamelets/azure-storage-blob-source.kamelet.yaml
index 633bfe8ad..c8e0e789f 100644
---
a/library/camel-kamelets/src/main/resources/kamelets/azure-storage-blob-source.kamelet.yaml
+++
b/library/camel-kamelets/src/main/resources/kamelets/azure-storage-blob-source.kamelet.yaml
@@ -39,7 +39,7 @@ spec:
Output: the body is the content of the blob, as a stream of bytes, and
the `Content-Type` header is `application/octet-stream`. The headers give the
name of the blob (`CamelAzureStorageBlobBlobName`, with its folder path), its
type, content type, size, ETag and last-modified time.
- Good to know: blobs are kept after they are read, so the same blobs are
read again on every poll, every 500 milliseconds by default; set
`deleteAfterRead` to true to delete each blob once it has been processed, or
`moveAfterRead` to move it to another container. It reads all the blobs of the
container, those in virtual folders too, unless `prefix` or `regex` narrows
them down. With `deleteAfterRead`, the blob deleted is the one named in the
`CamelAzureStorageBlobBlobName` header wh [...]
+ Good to know: blobs are kept after they are read, so the same blobs are
read again on every poll, every 500 milliseconds by default; set
`deleteAfterRead` to true to delete each blob once it has been processed, or
`moveAfterRead` to move it to another container. A poll gets all its blobs
before it sends the first one; to read a large container in smaller polls, set
`maxMessagesPerPoll`. It reads all the blobs of the container, those in virtual
folders too, unless `prefix` or `regex [...]
required:
- accountName
- containerName
@@ -103,6 +103,11 @@ spec:
description: If true, each blob is deleted from the container once it
has been processed. When false, the blobs stay and are read again on every poll.
type: boolean
default: false
+ maxMessagesPerPoll:
+ title: Max Blobs Per Poll
+ description: The most blobs to read in one poll. The next poll goes on
with the blobs after them, and after the last blob of the container it starts
again from the first, so every blob is reached, also when the blobs are kept.
When it is not set, each poll reads all the blobs of the container.
+ type: integer
+ example: 100
prefix:
title: Blob Name Prefix
description: Reads only the blobs whose name starts with this text,
such as `in/` for the blobs in the virtual folder `in` and its subfolders, or
`invoice-`. Ignored when `regex` is set. When neither is set, all the blobs of
the container are read.
@@ -213,6 +218,7 @@ spec:
credentialType: "{{credentialType}}"
sasToken: "RAW({{?sasToken}})"
delay: "{{delay}}"
+ maxMessagesPerPoll: "{{?maxMessagesPerPoll}}"
prefix: "RAW({{?prefix}})"
regex: "RAW({{?regex}})"
moveAfterRead: "{{?moveAfterRead}}"
diff --git
a/library/camel-kamelets/src/main/resources/kamelets/azure-storage-datalake-source.kamelet.yaml
b/library/camel-kamelets/src/main/resources/kamelets/azure-storage-datalake-source.kamelet.yaml
index e4cf42468..a40252555 100644
---
a/library/camel-kamelets/src/main/resources/kamelets/azure-storage-datalake-source.kamelet.yaml
+++
b/library/camel-kamelets/src/main/resources/kamelets/azure-storage-datalake-source.kamelet.yaml
@@ -39,7 +39,7 @@ spec:
Output: the body is the content of the file, as a stream of bytes, and
the `Content-Type` header is `application/octet-stream`. The
`CamelAzureStorageDataLakeFileName` header is the name of the file, and other
headers give its size, content type, ETag and last-modified time.
- Good to know: it neither deletes nor moves the files, so it reads all of
them again on every poll, every 500 milliseconds by default. It reads the files
at the top of the file system, or of `directoryName`; the files in directories
below are read only when `recursive` is true. `regex` keeps only the files
whose path matches, and `fileName` reads one file. Log in as an app
registration with `clientId`, `clientSecret` and `tenantId` (the default), or
with an account key (`accountKey` [...]
+ Good to know: unless `deleteAfterRead` is true, it neither deletes nor
moves the files, so it reads all of them again on every poll, every 500
milliseconds by default. With `deleteAfterRead`, a file is deleted once its
message was handled; a file whose message failed is kept and read again at the
next poll. It reads the files at the top of the file system, or of
`directoryName`; the files in directories below are read only when `recursive`
is true. `regex` keeps only the files whos [...]
required:
- accountName
- fileSystemName
@@ -126,6 +126,10 @@ spec:
type: string
example: exports/sales.csv
pattern: "^[^?#]+$"
+ deleteAfterRead:
+ title: Delete After Read
+ description: "If true, a file is deleted from the file system once its
message was handled, so it is read only once. A file whose message failed is
kept and read again at the next poll. When not set, the files are kept."
+ type: boolean
dataTypes:
out:
default: binary
@@ -284,6 +288,7 @@ spec:
recursive: "{{?recursive}}"
regex: "RAW({{?regex}})"
fileName: "RAW({{?fileName}})"
+ deleteAfterRead: "{{?deleteAfterRead}}"
steps:
- to:
uri: kamelet:sink
diff --git
a/library/camel-kamelets/src/main/resources/kamelets/google-storage-sink.kamelet.yaml
b/library/camel-kamelets/src/main/resources/kamelets/google-storage-sink.kamelet.yaml
index f2f307970..e12563489 100644
---
a/library/camel-kamelets/src/main/resources/kamelets/google-storage-sink.kamelet.yaml
+++
b/library/camel-kamelets/src/main/resources/kamelets/google-storage-sink.kamelet.yaml
@@ -68,6 +68,12 @@ spec:
type: string
example: status/latest.json
pattern: "^[^\\r\\n]+$"
+ storageClass:
+ title: Storage Class
+ description: "The storage class of the uploaded files, which sets what
storing and reading them costs: `STANDARD`, `NEARLINE` (for files read about
once a month), `COLDLINE` (once a quarter) or `ARCHIVE` (once a year). When it
is not set, a file gets the default storage class of the bucket."
+ type: string
+ enum: ["STANDARD", "NEARLINE", "COLDLINE", "ARCHIVE"]
+ example: NEARLINE
storageLocation:
title: Storage Location
description: The location of the bucket that `autoCreateBucket`
creates, such as a region (`europe-west1`) or a multi-region (`EU`). Only used
when the bucket is created. When it is not set, it is `US-EAST1`.
@@ -145,4 +151,4 @@ spec:
simple:
expression: "${exchangeId}"
- to:
- uri:
"google-storage://{{bucketNameOrArn}}?autoCreateBucket={{autoCreateBucket}}&impersonatedServiceAccount={{?impersonatedServiceAccount}}&objectName=RAW({{?objectName}})&serviceAccountKey=RAW(base64:{{?serviceAccountKey}})&storageLocation={{?storageLocation}}&useWorkloadIdentityFederation={{?useWorkloadIdentityFederation}}&workloadIdentityConfig={{?workloadIdentityConfig}}"
+ uri:
"google-storage://{{bucketNameOrArn}}?autoCreateBucket={{autoCreateBucket}}&impersonatedServiceAccount={{?impersonatedServiceAccount}}&objectName=RAW({{?objectName}})&objectStorageClass={{?storageClass}}&serviceAccountKey=RAW(base64:{{?serviceAccountKey}})&storageLocation={{?storageLocation}}&useWorkloadIdentityFederation={{?useWorkloadIdentityFederation}}&workloadIdentityConfig={{?workloadIdentityConfig}}"
diff --git
a/library/camel-kamelets/src/main/resources/kamelets/nominatim-geocode-action.kamelet.yaml
b/library/camel-kamelets/src/main/resources/kamelets/nominatim-geocode-action.kamelet.yaml
index fbbd5e7b9..3b6474b9f 100644
---
a/library/camel-kamelets/src/main/resources/kamelets/nominatim-geocode-action.kamelet.yaml
+++
b/library/camel-kamelets/src/main/resources/kamelets/nominatim-geocode-action.kamelet.yaml
@@ -40,7 +40,7 @@ spec:
Output: the body is JSON text, as bytes, with `Content-Type:
application/json`: an array with the best match, with its coordinates, its full
address and its kind of place, or an empty array when nothing matches. The
headers give the same answer in short: `CamelGeoCoderLat` and
`CamelGeoCoderLng` (the coordinates), `CamelGeoCoderAddress` (the full address
found), `CamelGeoCoderCity`, `CamelGeoCoderCountryLong`,
`CamelGeoCoderPostalCode` and `CamelGeoCoderStatus`, which is `OK` when [...]
- Good to know: a place that is not found does not fail the message; check
`CamelGeoCoderStatus`. The public server `https://nominatim.openstreetmap.org`
limits how often it may be called; for many lookups, run your own Nominatim
server. Headers that start with `CamelGeoCoder` are removed from the message
first, so they cannot change what the Kamelet does.
+ Good to know: a place that is not found does not fail the message; check
`CamelGeoCoderStatus`. The address, the city and the country are in English,
unless `language` asks for another language. The public server
`https://nominatim.openstreetmap.org` limits how often it may be called; for
many lookups, run your own Nominatim server. Headers that start with
`CamelGeoCoder` are removed from the message first, so they cannot change what
the Kamelet does.
required:
- serverUrl
type: object
@@ -50,6 +50,11 @@ spec:
description: "The address of the Nominatim server, starting with
`https://`, without a path. Use the public OpenStreetMap server for a few
lookups, or your own server."
example: "https://nominatim.openstreetmap.org"
type: string
+ language:
+ title: Language
+ description: "The language of the answer, such as of the address, the
city and the country, as a language code such as `en`, `de` or `fr`. It is sent
to Nominatim as `accept-language`. When not set, the answer is in English."
+ type: string
+ example: de
dataTypes:
in:
default: text
@@ -154,6 +159,7 @@ spec:
address: address
latlng: toOverride
serverUrl: "RAW({{serverUrl}})"
+ language: "{{?language}}"
type: NOMINATIM
- marshal:
json: {}
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 6108718fc..ab5820c73 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
@@ -167,6 +167,11 @@ spec:
description: "How long Pulsar may take to confirm a message before the
message fails, in milliseconds. For example, 30000 is 30 seconds."
type: integer
default: 30000
+ batcherBuilder:
+ title: Batcher
+ description: "How the messages are put in batches, when
`batchingEnabled` is true: `DEFAULT` batches the messages together whatever
their key; `KEY_BASED` batches the messages of each key separately, so that a
`Key_Shared` subscription spreads the keys over its consumers. When not set,
`DEFAULT`."
+ type: string
+ enum: ["DEFAULT", "KEY_BASED"]
type: object
template:
from:
@@ -187,4 +192,4 @@ spec:
simple:
expression: "${header[key]}"
- to:
- 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
[...]
+ uri:
"pulsar:{{topicType}}/{{tenant}}/{{namespaceName}}/{{topic}}?authenticationClass={{?authenticationClass}}&authenticationParams={{?authenticationParams}}&batcherBuilder={{?batcherBuilder}}&batchingEnabled={{?batchingEnabled}}&batchingMaxMessages={{?batchingMaxMessages}}&batchingMaxPublishDelayMicros={{?batchingMaxPublishDelayMicros}}&blockIfQueueFull={{?blockIfQueueFull}}&compressionType={{?compressionType}}&initialSequenceId={{?initialSequenceId}}&lazyStartProducer={{?la
[...]
diff --git
a/tests/camel-kamelets-itest/src/test/resources/aws/bedrock/aws-bedrock-text-sink-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/aws/bedrock/aws-bedrock-text-sink-converse-route.citrus.it.yaml
similarity index 61%
copy from
tests/camel-kamelets-itest/src/test/resources/aws/bedrock/aws-bedrock-text-sink-route.citrus.it.yaml
copy to
tests/camel-kamelets-itest/src/test/resources/aws/bedrock/aws-bedrock-text-sink-converse-route.citrus.it.yaml
index bbbd98bdc..48bbdd313 100644
---
a/tests/camel-kamelets-itest/src/test/resources/aws/bedrock/aws-bedrock-text-sink-route.citrus.it.yaml
+++
b/tests/camel-kamelets-itest/src/test/resources/aws/bedrock/aws-bedrock-text-sink-converse-route.citrus.it.yaml
@@ -15,31 +15,26 @@
# limitations under the License.
# ---------------------------------------------------------------------------
-name: aws-bedrock-text-sink-route-test
-# The body is the request of the model, and the answer of the model becomes
the body. The Citrus HTTP server stands in
-# for Bedrock, to check the request: Floci gives the same stub answer for
every model and request.
+name: aws-bedrock-text-sink-converse-route-test
+# With operation converse, the body is the prompt as text, sent as one user
message with the Converse API, together
+# with the guardrail; the answer of the model, as text, becomes the body. The
Citrus HTTP server stands in for Bedrock.
actions:
- camel:
cli:
run:
integration:
- file: "aws/bedrock/aws-bedrock-text-sink-route.yaml"
+ file: "aws/bedrock/aws-bedrock-text-sink-converse-route.yaml"
systemProperties:
file: "aws/aws-stand-in.properties"
- # The model of the option is called with the body, as JSON
+ # The Converse API of the model is called with the prompt and the guardrail
- http:
server: "awsSinkServer"
receiveRequest:
POST:
- path: "/model/amazon.titan-text-express-v1/invoke"
- headers:
- - name: "Content-Type"
- value: '@startsWith(''application/json'')@'
- - name: "Accept"
- value: 'application/json'
+ path: "/model/amazon.titan-text-express-v1/converse"
body:
- data: '{"inputText":"Summarize: the order ORD-1 has
shipped","textGenerationConfig":{"maxTokenCount":50}}'
+ data: '{"messages":[{"role":"user","content":[{"text":"Summarize:
the order ORD-1 has
shipped"}]}],"guardrailConfig":{"guardrailIdentifier":"gr-orders","guardrailVersion":"1","trace":"enabled"}}'
- http:
server: "awsSinkServer"
@@ -52,21 +47,22 @@ actions:
- name: "Content-Type"
value: 'application/json'
body:
- data:
'{"inputTextTokenCount":9,"results":[{"tokenCount":5,"outputText":"Order ORD-1
shipped.","completionReason":"FINISH"}]}'
+ data:
'{"output":{"message":{"role":"assistant","content":[{"text":"Order ORD-1
shipped."}]}},"stopReason":"end_turn","usage":{"inputTokens":9,"outputTokens":5,"totalTokens":14},"metrics":{"latencyMs":120}}'
- # The body is the answer of the model, as JSON text
+ # The body is the answer of the model, as text
- http:
server: "awsSinkServer"
receiveRequest:
POST:
path: "/result"
+ type: "plaintext"
headers:
- name: "X-Body-Type"
value: 'java.lang.String'
- - name: "X-Content-Type"
- value: 'ct=application/json'
+ - name: "X-Stop-Reason"
+ value: 'end_turn'
body:
- data:
'{"inputTextTokenCount":9,"results":[{"tokenCount":5,"outputText":"Order ORD-1
shipped.","completionReason":"FINISH"}]}'
+ data: 'Order ORD-1 shipped.'
- http:
server: "awsSinkServer"
sendResponse:
diff --git
a/tests/camel-kamelets-itest/src/test/resources/aws/bedrock/aws-bedrock-text-sink-converse-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/aws/bedrock/aws-bedrock-text-sink-converse-route.yaml
new file mode 100644
index 000000000..10f3eac28
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/aws/bedrock/aws-bedrock-text-sink-converse-route.yaml
@@ -0,0 +1,49 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+- route:
+ from:
+ uri: "timer:tick"
+ parameters:
+ period: "1000"
+ repeatCount: 1
+ steps:
+ # With converse, the body is the bare prompt
+ - setBody:
+ constant: 'Summarize: the order ORD-1 has shipped'
+ - to:
+ uri: "kamelet:aws-bedrock-text-sink"
+ parameters:
+ modelId: "amazon.titan-text-express-v1"
+ operation: "converse"
+ guardrailIdentifier: "gr-orders"
+ guardrailVersion: "1"
+ guardrailTrace: "true"
+ accessKey: "{{aws.accessKey}}"
+ secretKey: "{{aws.secretKey}}"
+ region: "{{aws.region}}"
+ overrideEndpoint: "true"
+ uriEndpointOverride: "{{aws.uriEndpointOverride}}"
+ # What the Kamelet leaves on the message
+ - setHeader:
+ name: X-Body-Type
+ simple: "${body.getClass().getName()}"
+ - setHeader:
+ name: X-Stop-Reason
+ simple: "${header.CamelAwsBedrockConverseStopReason}"
+ - to:
+ uri: "{{http.sink.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/aws/bedrock/aws-bedrock-text-sink-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/aws/bedrock/aws-bedrock-text-sink-route.citrus.it.yaml
index bbbd98bdc..d462385e2 100644
---
a/tests/camel-kamelets-itest/src/test/resources/aws/bedrock/aws-bedrock-text-sink-route.citrus.it.yaml
+++
b/tests/camel-kamelets-itest/src/test/resources/aws/bedrock/aws-bedrock-text-sink-route.citrus.it.yaml
@@ -64,7 +64,7 @@ actions:
- name: "X-Body-Type"
value: 'java.lang.String'
- name: "X-Content-Type"
- value: 'ct=application/json'
+ value: 'ct='
body:
data:
'{"inputTextTokenCount":9,"results":[{"tokenCount":5,"outputText":"Order ORD-1
shipped.","completionReason":"FINISH"}]}'
- http:
diff --git
a/tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/aws/lambda/aws-lambda-sink-async-route.citrus.it.yaml
similarity index 54%
copy from
tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-route.citrus.it.yaml
copy to
tests/camel-kamelets-itest/src/test/resources/aws/lambda/aws-lambda-sink-async-route.citrus.it.yaml
index b735797ed..8db3ee8e2 100644
---
a/tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-route.citrus.it.yaml
+++
b/tests/camel-kamelets-itest/src/test/resources/aws/lambda/aws-lambda-sink-async-route.citrus.it.yaml
@@ -15,61 +15,58 @@
# limitations under the License.
# ---------------------------------------------------------------------------
-name: nominatim-geocode-action-route-test
+name: aws-lambda-sink-async-route-test
+# With invocationType Event, the function is called asynchronously: AWS Lambda
queues the event and answers at
+# once with status code 202 and no body. The Citrus HTTP server stands in for
AWS Lambda.
actions:
- camel:
cli:
run:
- waitForRunningState: false
integration:
- file: "geo/nominatim-geocode-action-route.yaml"
+ file: "aws/lambda/aws-lambda-sink-async-route.yaml"
+ environment:
+ variables:
+ - name: "AWS_ENDPOINT_URL_LAMBDA"
+ value: "http://localhost:${aws.sink.server.port}"
systemProperties:
- properties:
- - name: "http.sink.url"
- value: "http://localhost:${http.server.port}"
- - name: "http.server.port"
- value: "${http.server.port}"
+ file: "aws/aws-stand-in.properties"
+ # The call asks for an asynchronous invocation
- http:
- server: "httpServer"
+ server: "awsSinkServer"
receiveRequest:
- GET:
- path: "/search"
-
+ POST:
+ path: "/2015-03-31/functions/enrich-order/invocations"
+ headers:
+ - name: "X-Amz-Invocation-Type"
+ value: "Event"
+ body:
+ data: '{"orderId":"A-1"}'
- http:
- server: "httpServer"
+ server: "awsSinkServer"
sendResponse:
response:
- status: 200
- reasonPhrase: "OK"
+ status: 202
+ reasonPhrase: "Accepted"
version: "HTTP/1.1"
- headers:
- - name: "Content-Type"
- value: "application/json"
- body:
- data:
'[{"place_id":1,"lat":"52.5170365","lon":"13.3888599","display_name":"Berlin,
Germany","type":"city","class":"boundary","importance":0.9,"address":{"city":"Berlin","country":"Germany","country_code":"de"}}]'
+ # The status code is 202 and the body is empty
- http:
- server: "httpServer"
+ server: "awsSinkServer"
receiveRequest:
POST:
path: "/result"
headers:
- - name: "X-Body-Type"
- value: '[B'
- - name: "X-Content-Type"
- value: 'ct=application/json'
- - name: "X-Lat"
- value: '52.51703650'
- - name: "X-Lng"
- value: '@startsWith(''13.38885'')@'
-
+ - name: "X-Status-Code"
+ value: '202'
+ - name: "X-Body"
+ value: 'body='
- http:
- server: "httpServer"
+ server: "awsSinkServer"
sendResponse:
response:
status: 200
reasonPhrase: "OK"
version: "HTTP/1.1"
body:
- data: 'OK'
+ data: "OK"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/aws/lambda/aws-lambda-sink-async-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/aws/lambda/aws-lambda-sink-async-route.yaml
new file mode 100644
index 000000000..420e66a28
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/aws/lambda/aws-lambda-sink-async-route.yaml
@@ -0,0 +1,46 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+- route:
+ from:
+ uri: "timer:tick"
+ parameters:
+ period: "1000"
+ repeatCount: 1
+ steps:
+ - setBody:
+ constant: '{"orderId":"A-1"}'
+ - to:
+ uri: "kamelet:aws-lambda-sink"
+ parameters:
+ function: "enrich-order"
+ invocationType: "Event"
+ accessKey: "{{aws.accessKey}}"
+ secretKey: "{{aws.secretKey}}"
+ region: "{{aws.region}}"
+ # What the Kamelet leaves on the message
+ - setHeader:
+ name: X-Body-Type
+ simple: "${iif(${body} == null,null,${body.getClass().getName()})}"
+ - setHeader:
+ name: X-Body
+ simple: "body=${body}"
+ - setHeader:
+ name: X-Status-Code
+ simple: '${header.CamelAwsLambdaStatusCode}'
+ - to:
+ uri: "{{http.sink.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/aws/timestream/aws-timestream-query-sink-all-pages-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/aws/timestream/aws-timestream-query-sink-all-pages-route.citrus.it.yaml
new file mode 100644
index 000000000..53a0c6788
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/aws/timestream/aws-timestream-query-sink-all-pages-route.citrus.it.yaml
@@ -0,0 +1,101 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+name: aws-timestream-query-sink-all-pages-route-test
+# With queryAllPages, the Kamelet reads the next pages with the NextToken of
each answer, and gives all the rows in
+# one answer. The Citrus HTTP server stands in for Timestream.
+actions:
+ - camel:
+ cli:
+ run:
+ integration:
+ file:
"aws/timestream/aws-timestream-query-sink-all-pages-route.yaml"
+ systemProperties:
+ file: "aws/aws-stand-in.properties"
+
+ # The first page, with the token of the next one
+ - http:
+ server: "awsSinkServer"
+ receiveRequest:
+ POST:
+ path: "/"
+ headers:
+ - name: "X-Amz-Target"
+ value: 'Timestream_20181101.Query'
+ validate:
+ - jsonPath:
+ - expression: '$.QueryString'
+ value: 'SELECT sensor, temperature FROM sensors.readings'
+ - http:
+ server: "awsSinkServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+ headers:
+ - name: "Content-Type"
+ value: 'application/x-amz-json-1.0'
+ body:
+ data:
'{"QueryId":"query-1","NextToken":"page-2","Rows":[{"Data":[{"ScalarValue":"sensor-1"},{"ScalarValue":"21.5"}]}],"ColumnInfo":[{"Name":"sensor","Type":{"ScalarType":"VARCHAR"}},{"Name":"temperature","Type":{"ScalarType":"DOUBLE"}}]}'
+
+ # The second page is asked for with that token
+ - http:
+ server: "awsSinkServer"
+ receiveRequest:
+ POST:
+ path: "/"
+ validate:
+ - jsonPath:
+ - expression: '$.NextToken'
+ value: 'page-2'
+ - http:
+ server: "awsSinkServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+ headers:
+ - name: "Content-Type"
+ value: 'application/x-amz-json-1.0'
+ body:
+ data:
'{"QueryId":"query-1","Rows":[{"Data":[{"ScalarValue":"sensor-2"},{"ScalarValue":"19.0"}]}],"ColumnInfo":[{"Name":"sensor","Type":{"ScalarType":"VARCHAR"}},{"Name":"temperature","Type":{"ScalarType":"DOUBLE"}}]}'
+
+ # One answer with the rows of both pages
+ - http:
+ server: "awsSinkServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Body-Type"
+ value:
'software.amazon.awssdk.services.timestreamquery.model.QueryResponse'
+ - name: "X-Rows"
+ value: '2'
+ body:
+ data: 'sensor-1,sensor-2'
+ - http:
+ server: "awsSinkServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+ body:
+ data: "OK"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/aws/timestream/aws-timestream-query-sink-all-pages-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/aws/timestream/aws-timestream-query-sink-all-pages-route.yaml
new file mode 100644
index 000000000..59105a738
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/aws/timestream/aws-timestream-query-sink-all-pages-route.yaml
@@ -0,0 +1,47 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+- route:
+ from:
+ uri: "timer:tick"
+ parameters:
+ period: "1000"
+ repeatCount: 1
+ steps:
+ - setHeader:
+ name: query
+ constant: 'SELECT sensor, temperature FROM sensors.readings'
+ - to:
+ uri: "kamelet:aws-timestream-query-sink"
+ parameters:
+ queryAllPages: "true"
+ accessKey: "{{aws.accessKey}}"
+ secretKey: "{{aws.secretKey}}"
+ region: "{{aws.region}}"
+ overrideEndpoint: "true"
+ uriEndpointOverride: "{{aws.uriEndpointOverride}}"
+ # all the rows of the two pages are in one answer
+ - setHeader:
+ name: X-Body-Type
+ simple: "${body.getClass().getName()}"
+ - setHeader:
+ name: X-Rows
+ simple: '${body.rows().size()}'
+ - setBody:
+ simple:
'${body.rows()[0].data()[0].scalarValue()},${body.rows()[1].data()[0].scalarValue()}'
+ - to:
+ uri: "{{http.sink.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/azure/azure-storage-blob-source-limit-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/azure/azure-storage-blob-source-limit-route.citrus.it.yaml
new file mode 100644
index 000000000..886330283
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/azure/azure-storage-blob-source-limit-route.citrus.it.yaml
@@ -0,0 +1,186 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+name: azure-storage-blob-source-limit-route-test
+description: 'azure-storage-blob-source with maxMessagesPerPoll reads three
blobs in a poll of two and a poll of one'
+actions:
+ # Start the Floci Azure emulator, which serves Blob, Queue and Data Lake
storage on one port. It does not check the
+ # account key.
+ - testcontainers:
+ start:
+ container:
+ name: "azure"
+ image: "floci/floci-az:0.16.0"
+ autoRemove: true
+ startUpTimeout: 120
+ exposedPorts:
+ - 4577
+ waitFor:
+ logMessage: '.*floci-az is ready.*'
+
+ # The container orders, with three blobs
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_AZURE_HOST}:${CITRUS_TESTCONTAINERS_AZURE_PORT}"
+ sendRequest:
+ PUT:
+ path: "/devstoreaccount1/orders"
+ parameters:
+ - name: "restype"
+ value: 'container'
+ headers:
+ - name: "x-ms-version"
+ value: '2025-11-05'
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_AZURE_HOST}:${CITRUS_TESTCONTAINERS_AZURE_PORT}"
+ receiveResponse:
+ response:
+ status: 201
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_AZURE_HOST}:${CITRUS_TESTCONTAINERS_AZURE_PORT}"
+ sendRequest:
+ PUT:
+ path: "/devstoreaccount1/orders/in/order-1.txt"
+ contentType: "text/plain"
+ headers:
+ - name: "x-ms-version"
+ value: '2025-11-05'
+ - name: "x-ms-blob-type"
+ value: 'BlockBlob'
+ body:
+ data: 'Order 1'
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_AZURE_HOST}:${CITRUS_TESTCONTAINERS_AZURE_PORT}"
+ receiveResponse:
+ response:
+ status: 201
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_AZURE_HOST}:${CITRUS_TESTCONTAINERS_AZURE_PORT}"
+ sendRequest:
+ PUT:
+ path: "/devstoreaccount1/orders/in/order-2.txt"
+ contentType: "text/plain"
+ headers:
+ - name: "x-ms-version"
+ value: '2025-11-05'
+ - name: "x-ms-blob-type"
+ value: 'BlockBlob'
+ body:
+ data: 'Order 2'
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_AZURE_HOST}:${CITRUS_TESTCONTAINERS_AZURE_PORT}"
+ receiveResponse:
+ response:
+ status: 201
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_AZURE_HOST}:${CITRUS_TESTCONTAINERS_AZURE_PORT}"
+ sendRequest:
+ PUT:
+ path: "/devstoreaccount1/orders/in/order-3.txt"
+ contentType: "text/plain"
+ headers:
+ - name: "x-ms-version"
+ value: '2025-11-05'
+ - name: "x-ms-blob-type"
+ value: 'BlockBlob'
+ body:
+ data: 'Order 3'
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_AZURE_HOST}:${CITRUS_TESTCONTAINERS_AZURE_PORT}"
+ receiveResponse:
+ response:
+ status: 201
+
+ # Create Camel JBang integration
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "azure/azure-storage-blob-source-limit-route.yaml"
+ systemProperties:
+ properties:
+ - name: "http.sink.url"
+ value: "http://localhost:${azure.server.port}"
+ - name: "azure.url"
+ value:
"http://${CITRUS_TESTCONTAINERS_AZURE_HOST}:${CITRUS_TESTCONTAINERS_AZURE_PORT}"
+ - name: "azure.accountName"
+ value: "devstoreaccount1"
+ - name: "azure.accessKey"
+ value: "a2FtZWxldHM="
+ resources:
+ - "AzureBlobClient.java"
+
+ # The first poll reads two blobs, and the next poll the third
+ - http:
+ server: "azureServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Blob-Name"
+ value: 'in/order-1.txt'
+ - name: "X-Batch-Size"
+ value: '2'
+ body:
+ data: 'Order 1'
+ - http:
+ server: "azureServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+ - http:
+ server: "azureServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Blob-Name"
+ value: 'in/order-2.txt'
+ - name: "X-Batch-Size"
+ value: '2'
+ body:
+ data: 'Order 2'
+ - http:
+ server: "azureServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+ - http:
+ server: "azureServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Blob-Name"
+ value: 'in/order-3.txt'
+ - name: "X-Batch-Size"
+ value: '1'
+ body:
+ data: 'Order 3'
+ - http:
+ server: "azureServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/azure/azure-storage-blob-source-limit-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/azure/azure-storage-blob-source-limit-route.yaml
new file mode 100644
index 000000000..a6838a9b7
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/azure/azure-storage-blob-source-limit-route.yaml
@@ -0,0 +1,41 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+- route:
+ from:
+ uri: "kamelet:azure-storage-blob-source"
+ parameters:
+ accountName: '{{azure.accountName}}'
+ containerName: 'orders'
+ accessKey: '{{azure.accessKey}}'
+ deleteAfterRead: 'true'
+ maxMessagesPerPoll: 2
+ delay: 2000
+ steps:
+ # the blob, and how many blobs the poll that read it has
+ - setHeader:
+ name: X-Blob-Name
+ simple: "${header.CamelAzureStorageBlobBlobName}"
+ - setHeader:
+ name: X-Batch-Size
+ simple: "${exchangeProperty.CamelBatchSize}"
+ - removeHeader:
+ name: Content-Type
+ - convertBodyTo:
+ type: "java.lang.String"
+ - to:
+ uri: "{{http.sink.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/azure/azure-storage-datalake-source-delete-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/azure/azure-storage-datalake-source-delete-route.citrus.it.yaml
new file mode 100644
index 000000000..f7680e893
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/azure/azure-storage-datalake-source-delete-route.citrus.it.yaml
@@ -0,0 +1,133 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+name: azure-storage-datalake-source-delete-route-test
+description: 'azure-storage-datalake-source with deleteAfterRead reads a file
once, and deletes it'
+actions:
+ # Start the Floci Azure emulator, which serves Blob, Queue and Data Lake
storage on one port. It does not check the
+ # account key.
+ - testcontainers:
+ start:
+ container:
+ name: "azure"
+ image: "floci/floci-az:0.16.0"
+ autoRemove: true
+ startUpTimeout: 120
+ exposedPorts:
+ - 4577
+ waitFor:
+ logMessage: '.*floci-az is ready.*'
+
+ # The file system lake, with a file in the directory in
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_AZURE_HOST}:${CITRUS_TESTCONTAINERS_AZURE_PORT}"
+ sendRequest:
+ PUT:
+ path: "/devstoreaccount1/lake"
+ parameters:
+ - name: "restype"
+ value: 'container'
+ headers:
+ - name: "x-ms-version"
+ value: '2025-11-05'
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_AZURE_HOST}:${CITRUS_TESTCONTAINERS_AZURE_PORT}"
+ receiveResponse:
+ response:
+ status: 201
+
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_AZURE_HOST}:${CITRUS_TESTCONTAINERS_AZURE_PORT}"
+ sendRequest:
+ PUT:
+ path: "/devstoreaccount1/lake/in/order-1.txt"
+ contentType: "text/plain"
+ headers:
+ - name: "x-ms-version"
+ value: '2025-11-05'
+ - name: "x-ms-blob-type"
+ value: 'BlockBlob'
+ body:
+ data: 'Hello Azure Data Lake'
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_AZURE_HOST}:${CITRUS_TESTCONTAINERS_AZURE_PORT}"
+ receiveResponse:
+ response:
+ status: 201
+
+ # Create Camel JBang integration
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "azure/azure-storage-datalake-source-delete-route.yaml"
+ systemProperties:
+ properties:
+ - name: "http.sink.url"
+ value: "http://localhost:${azure.server.port}"
+ - name: "azure.url"
+ value:
"http://${CITRUS_TESTCONTAINERS_AZURE_HOST}:${CITRUS_TESTCONTAINERS_AZURE_PORT}"
+ - name: "azure.accountName"
+ value: "devstoreaccount1"
+ - name: "azure.accessKey"
+ value: "a2FtZWxldHM="
+ resources:
+ - "AzureDataLakeClient.java"
+
+ # The content of the file, as a stream, with its path
+ - http:
+ server: "azureServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Body-Type"
+ value: 'org.apache.camel.converter.stream.InputStreamCache'
+ - name: "X-Content-Type"
+ value: 'ct=application/octet-stream'
+ - name: "X-File-Name"
+ value: 'in/order-1.txt'
+ body:
+ data: 'Hello Azure Data Lake'
+ - http:
+ server: "azureServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+
+ # The file is deleted once its message was handled
+ - repeatOnError:
+ until: "i > 30"
+ autoSleep: 1000
+ actions:
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_AZURE_HOST}:${CITRUS_TESTCONTAINERS_AZURE_PORT}"
+ sendRequest:
+ HEAD:
+ path: "/devstoreaccount1/lake/in/order-1.txt"
+ headers:
+ - name: "x-ms-version"
+ value: '2025-11-05'
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_AZURE_HOST}:${CITRUS_TESTCONTAINERS_AZURE_PORT}"
+ receiveResponse:
+ response:
+ status: 404
diff --git
a/tests/camel-kamelets-itest/src/test/resources/azure/azure-storage-datalake-source-delete-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/azure/azure-storage-datalake-source-delete-route.yaml
new file mode 100644
index 000000000..7053acdaf
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/azure/azure-storage-datalake-source-delete-route.yaml
@@ -0,0 +1,44 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+- route:
+ from:
+ uri: "kamelet:azure-storage-datalake-source"
+ parameters:
+ accountName: '{{azure.accountName}}'
+ fileSystemName: 'lake'
+ credentialType: 'SERVICE_CLIENT_INSTANCE'
+ directoryName: 'in'
+ deleteAfterRead: 'true'
+ steps:
+ # what the Kamelet gives: the Java type of the body and the
Content-Type
+ - setHeader:
+ name: X-Body-Type
+ simple: "${body.getClass().getName()}"
+ - setHeader:
+ name: X-Content-Type
+ simple: "ct=${header.Content-Type}"
+ - setHeader:
+ name: X-File-Name
+ simple: "${header.CamelAzureStorageDataLakeFileName}"
+ # the body as text, for the HTTP call: Citrus reads an
application/octet-stream body as a byte array
+ - removeHeader:
+ name: Content-Type
+ - convertBodyTo:
+ type: "java.lang.String"
+ - to:
+ uri: "{{http.sink.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-language-route.citrus.it.yaml
similarity index 92%
copy from
tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-route.citrus.it.yaml
copy to
tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-language-route.citrus.it.yaml
index b735797ed..74d1f031a 100644
---
a/tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-route.citrus.it.yaml
+++
b/tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-language-route.citrus.it.yaml
@@ -15,14 +15,14 @@
# limitations under the License.
# ---------------------------------------------------------------------------
-name: nominatim-geocode-action-route-test
+name: nominatim-geocode-action-language-route-test
actions:
- camel:
cli:
run:
waitForRunningState: false
integration:
- file: "geo/nominatim-geocode-action-route.yaml"
+ file: "geo/nominatim-geocode-action-language-route.yaml"
systemProperties:
properties:
- name: "http.sink.url"
@@ -35,6 +35,9 @@ actions:
receiveRequest:
GET:
path: "/search"
+ parameters:
+ - name: "accept-language"
+ value: "de"
- http:
server: "httpServer"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-language-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-language-route.yaml
new file mode 100644
index 000000000..648dc3594
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-language-route.yaml
@@ -0,0 +1,45 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+- route:
+ from:
+ uri: "timer:tick"
+ parameters:
+ period: "1000"
+ repeatCount: 1
+ steps:
+ - setBody:
+ constant: 'Berlin'
+ - to:
+ uri: "kamelet:nominatim-geocode-action"
+ parameters:
+ serverUrl: 'http://localhost:{{http.server.port}}'
+ language: 'de'
+ - setHeader:
+ name: X-Body-Type
+ simple: "${body.getClass().getName()}"
+ - setHeader:
+ name: X-Content-Type
+ simple: "ct=${header.Content-Type}"
+ - setHeader:
+ name: X-Lat
+ simple: '${header.CamelGeoCoderLat}'
+ - setHeader:
+ name: X-Lng
+ simple: '${header.CamelGeoCoderLng}'
+ - to:
+ uri: "{{http.sink.url}}/result"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-route.citrus.it.yaml
index b735797ed..1c6eae443 100644
---
a/tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-route.citrus.it.yaml
+++
b/tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-route.citrus.it.yaml
@@ -35,6 +35,9 @@ actions:
receiveRequest:
GET:
path: "/search"
+ parameters:
+ - name: "accept-language"
+ value: "en"
- http:
server: "httpServer"
diff --git
a/tests/camel-kamelets-itest/src/test/resources/google/google-storage-sink-storage-class-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/google/google-storage-sink-storage-class-route.citrus.it.yaml
new file mode 100644
index 000000000..5420e375f
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/google/google-storage-sink-storage-class-route.citrus.it.yaml
@@ -0,0 +1,105 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+name: google-storage-sink-storage-class-route-test
+description: 'google-storage-sink uploads the body with the storage class of
storageClass'
+actions:
+ # Start the Floci GCP emulator, which serves Pub/Sub, Cloud Storage and
BigQuery on one port, without logging in
+ - testcontainers:
+ start:
+ container:
+ name: "gcp"
+ image: "floci/floci-gcp:0.12.0"
+ autoRemove: true
+ startUpTimeout: 120
+ exposedPorts:
+ - 4588
+ waitFor:
+ logMessage: '.*Listening on.*'
+
+ # The bucket kamelets-orders
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_GCP_HOST}:${CITRUS_TESTCONTAINERS_GCP_PORT}"
+ sendRequest:
+ POST:
+ path: "/storage/v1/b"
+ contentType: "application/json"
+ parameters:
+ - name: "project"
+ value: 'kamelets'
+ body:
+ data: '{"name":"kamelets-orders"}'
+ - http:
+ client:
"http://${CITRUS_TESTCONTAINERS_GCP_HOST}:${CITRUS_TESTCONTAINERS_GCP_PORT}"
+ receiveResponse:
+ response:
+ status: 200
+
+ # Create Camel JBang integration
+ - camel:
+ cli:
+ run:
+ waitForRunningState: false
+ integration:
+ file: "google/google-storage-sink-storage-class-route.yaml"
+ systemProperties:
+ properties:
+ - name: "http.sink.url"
+ value: "http://localhost:${gcp.server.port}"
+ - name: "gcp.url"
+ value:
"http://${CITRUS_TESTCONTAINERS_GCP_HOST}:${CITRUS_TESTCONTAINERS_GCP_PORT}"
+ - name: "gcp.projectId"
+ value: "kamelets"
+ - name: "gcp.serviceAccountKey"
+ value: "e30="
+ resources:
+ - "GoogleStorageClient.java"
+
+ # The file is uploaded with the storage class COLDLINE
+ - http:
+ server: "gcpServer"
+ receiveRequest:
+ POST:
+ path: "/result"
+ type: "plaintext"
+ headers:
+ - name: "X-Body-Type"
+ value: 'com.google.cloud.storage.Blob'
+ - name: "X-Content-Type"
+ value: 'ct='
+ - name: "X-Storage-Class"
+ value: 'COLDLINE'
+ - name: "X-Object-Name"
+ value: 'orders/order-1.txt'
+ body:
+ data: 'orders/order-1.txt size=19'
+ - http:
+ server: "gcpServer"
+ sendResponse:
+ response:
+ status: 200
+ reasonPhrase: "OK"
+ version: "HTTP/1.1"
+
+ # The file holds the body, and keeps its storage class
+ - camel:
+ cli:
+ verify:
+ integration: "google-storage-sink-storage-class-route"
+ logMessage: 'Read back orders/order-1.txt: Hello Cloud Storage
storageClass=COLDLINE'
+ maxAttempts: 30
+ delayBetweenAttempts: 1000
diff --git
a/tests/camel-kamelets-itest/src/test/resources/google/google-storage-sink-storage-class-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/google/google-storage-sink-storage-class-route.yaml
new file mode 100644
index 000000000..1467bfb2e
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/google/google-storage-sink-storage-class-route.yaml
@@ -0,0 +1,62 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+- route:
+ from:
+ uri: "timer:send"
+ parameters:
+ repeatCount: 1
+ steps:
+ - setBody:
+ constant: 'Hello Cloud Storage'
+ - setHeader:
+ name: file
+ constant: 'orders/order-1.txt'
+ - to:
+ uri: "kamelet:google-storage-sink"
+ parameters:
+ bucketNameOrArn: 'kamelets-orders'
+ storageClass: 'COLDLINE'
+ serviceAccountKey: '{{gcp.serviceAccountKey}}'
+ # what the Kamelet gives: the Java type of the body and the
Content-Type
+ - setHeader:
+ name: X-Body-Type
+ simple: "${body.getClass().getName()}"
+ - setHeader:
+ name: X-Content-Type
+ simple: "ct=${header.Content-Type}"
+ - setHeader:
+ name: X-Storage-Class
+ simple: "${body.getStorageClass()}"
+ - setHeader:
+ name: X-Object-Name
+ simple: "${header.CamelGoogleCloudStorageObjectName}"
+ # the body describes the file: its name and size, as text for the HTTP
call
+ - setBody:
+ simple: "${body.getName()} size=${body.getSize()}"
+ - to:
+ uri: "{{http.sink.url}}/result"
+ # read the file back, to show what arrived
+ - to:
+ uri: "google-storage://kamelets-orders"
+ parameters:
+ operation: getObject
+ objectName: 'orders/order-1.txt'
+ - convertBodyTo:
+ type: "java.lang.String"
+ - log:
+ message: 'Read back orders/order-1.txt: ${body}
storageClass=${header.CamelGoogleCloudStorageStorageClass}'
diff --git
a/tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-route.citrus.it.yaml
b/tests/camel-kamelets-itest/src/test/resources/pulsar/pulsar-sink-key-based-route.citrus.it.yaml
similarity index 53%
copy from
tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-route.citrus.it.yaml
copy to
tests/camel-kamelets-itest/src/test/resources/pulsar/pulsar-sink-key-based-route.citrus.it.yaml
index b735797ed..94531bdd0 100644
---
a/tests/camel-kamelets-itest/src/test/resources/geo/nominatim-geocode-action-route.citrus.it.yaml
+++
b/tests/camel-kamelets-itest/src/test/resources/pulsar/pulsar-sink-key-based-route.citrus.it.yaml
@@ -15,40 +15,38 @@
# limitations under the License.
# ---------------------------------------------------------------------------
-name: nominatim-geocode-action-route-test
+name: pulsar-sink-key-based-route-test
+description: 'pulsar-sink sends a text message, with a key from the key header
and properties from a Map, to a topic in Pulsar'
actions:
+ # Start Pulsar
+ - testcontainers:
+ start:
+ container:
+ name: "pulsar"
+ image: "apachepulsar/pulsar:5.0.1"
+ command: "bin/pulsar standalone"
+ autoRemove: true
+ startUpTimeout: 300
+ exposedPorts:
+ - 6650
+ waitFor:
+ logMessage: '.*Created namespace .*namespace=public/default.*'
+
+ # Create Camel JBang integration
- camel:
cli:
run:
waitForRunningState: false
integration:
- file: "geo/nominatim-geocode-action-route.yaml"
+ file: "pulsar/pulsar-sink-key-based-route.yaml"
systemProperties:
properties:
- name: "http.sink.url"
value: "http://localhost:${http.server.port}"
- - name: "http.server.port"
- value: "${http.server.port}"
-
- - http:
- server: "httpServer"
- receiveRequest:
- GET:
- path: "/search"
-
- - http:
- server: "httpServer"
- sendResponse:
- response:
- status: 200
- reasonPhrase: "OK"
- version: "HTTP/1.1"
- headers:
- - name: "Content-Type"
- value: "application/json"
- body:
- data:
'[{"place_id":1,"lat":"52.5170365","lon":"13.3888599","display_name":"Berlin,
Germany","type":"city","class":"boundary","importance":0.9,"address":{"city":"Berlin","country":"Germany","country_code":"de"}}]'
+ - name: "pulsar.service.url"
+ value:
"pulsar://${CITRUS_TESTCONTAINERS_PULSAR_HOST}:${CITRUS_TESTCONTAINERS_PULSAR_PORT}"
+ # After the Kamelet the body is the payload as bytes, with Content-Type
application/octet-stream
- http:
server: "httpServer"
receiveRequest:
@@ -57,13 +55,12 @@ actions:
headers:
- name: "X-Body-Type"
value: '[B'
+ - name: "X-Body"
+ value: 'Hello Pulsar'
- name: "X-Content-Type"
- value: 'ct=application/json'
- - name: "X-Lat"
- value: '52.51703650'
- - name: "X-Lng"
- value: '@startsWith(''13.38885'')@'
-
+ value: 'ct=application/octet-stream'
+ - name: "key"
+ value: 'order-1'
- http:
server: "httpServer"
sendResponse:
@@ -71,5 +68,12 @@ actions:
status: 200
reasonPhrase: "OK"
version: "HTTP/1.1"
- body:
- data: 'OK'
+
+ # The message is on the topic, with its key and properties
+ - camel:
+ cli:
+ verify:
+ integration: "pulsar-sink-key-based-route"
+ logMessage: 'Received from the topic: Hello Pulsar (key=order-1,
properties={origin=citrus})'
+ maxAttempts: 30
+ delayBetweenAttempts: 1000
diff --git
a/tests/camel-kamelets-itest/src/test/resources/pulsar/pulsar-sink-key-based-route.yaml
b/tests/camel-kamelets-itest/src/test/resources/pulsar/pulsar-sink-key-based-route.yaml
new file mode 100644
index 000000000..db74d8bbd
--- /dev/null
+++
b/tests/camel-kamelets-itest/src/test/resources/pulsar/pulsar-sink-key-based-route.yaml
@@ -0,0 +1,69 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+- route:
+ from:
+ uri: "timer:send"
+ parameters:
+ repeatCount: 1
+ steps:
+ - setBody:
+ constant: 'Hello Pulsar'
+ - setHeader:
+ name: key
+ constant: 'order-1'
+ - setHeader:
+ name: CamelPulsarProducerMessageProperties
+ groovy: "[origin: 'citrus']"
+ - to:
+ uri: "kamelet:pulsar-sink"
+ parameters:
+ serviceUrl: '{{pulsar.service.url}}'
+ topicType: 'persistent'
+ tenant: 'public'
+ namespaceName: 'default'
+ topic: 'orders'
+ batchingEnabled: 'true'
+ batcherBuilder: 'KEY_BASED'
+ # what the Kamelet gives: the Java type of the body and the
Content-Type
+ - setHeader:
+ name: X-Body-Type
+ simple: "${body.getClass().getName()}"
+ - setHeader:
+ name: X-Body
+ simple: "${bodyAs(String)}"
+ - setHeader:
+ name: X-Content-Type
+ simple: "ct=${header.Content-Type}"
+ - to:
+ uri: "{{http.sink.url}}/result"
+
+# reads the message back from the topic, to show that it arrived
+- route:
+ from:
+ uri: "kamelet:pulsar-source"
+ parameters:
+ serviceUrl: '{{pulsar.service.url}}'
+ topicType: 'persistent'
+ tenant: 'public'
+ namespaceName: 'default'
+ topic: 'orders'
+ subscriptionName: 'citrus'
+ subscriptionInitialPosition: 'EARLIEST'
+ steps:
+ - log:
+ message: 'Received from the topic: ${bodyAs(String)}
(key=${header.key}, properties=${header.properties})'