Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate some of headers with a different name - AWS SQS Source #1072

Merged
merged 3 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions kamelets/aws-sqs-source.kamelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ spec:
Access Key/Secret Key are the basic method for authenticating to the AWS SQS Service. These parameters are optional because the Kamelet provides the 'useDefaultCredentialsProvider'.

When using a default Credentials Provider the SQS client will load the credentials through this provider and won't use the static credential. This is reason for not having the access key and secret key as mandatory parameter for this Kamelet.

Two headers will be duplicated with different names for clarity at sink level, CamelAwsSqsMessageId will be duplicated into aws.sqs.message.id and CamelAwsSqsReceiptHandle will be duplicated in aws.sqs.receipt.handle
required:
- queueNameOrArn
- region
Expand Down Expand Up @@ -137,9 +139,23 @@ spec:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
default: false
dependencies:
- "camel:core"
- "camel:aws2-sqs"
- "github:apache.camel-kamelets:camel-kamelets-utils:main-SNAPSHOT"
- "camel:kamelet"
template:
beans:
- name: renameHeaders
type: "#class:org.apache.camel.kamelets.utils.headers.DuplicateNamingHeaders"
property:
- key: prefix
value: 'CamelAwsSqs'
- key: renamingPrefix
value: 'aws.sqs.'
- key: mode
value: 'filtering'
- key: selectedHeaders
value: 'CamelAwsSqsReceiptHandle,CamelAwsSqsMessageId'
from:
uri: "aws2-sqs:{{queueNameOrArn}}"
parameters:
Expand All @@ -156,4 +172,6 @@ spec:
delay: "{{delay}}"
greedy: "{{greedy}}"
steps:
- process:
ref: "{{renameHeaders}}"
- to: "kamelet:sink"
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void testGetKameletsByGroup() throws Exception {
@Test
void testGetKameletsDependencies() throws Exception {
List<String> deps = catalog.getKameletDependencies("aws-sqs-source");
assertEquals(2, deps.size());
assertEquals(4, deps.size());
deps = catalog.getKameletDependencies("cassandra-sink");
assertEquals(3, deps.size());
assertEquals("camel:jackson", deps.get(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ spec:
Access Key/Secret Key are the basic method for authenticating to the AWS SQS Service. These parameters are optional because the Kamelet provides the 'useDefaultCredentialsProvider'.

When using a default Credentials Provider the SQS client will load the credentials through this provider and won't use the static credential. This is reason for not having the access key and secret key as mandatory parameter for this Kamelet.

Two headers will be duplicated with different names for clarity at sink level, CamelAwsSqsMessageId will be duplicated into aws.sqs.message.id and CamelAwsSqsReceiptHandle will be duplicated in aws.sqs.receipt.handle
required:
- queueNameOrArn
- region
Expand Down Expand Up @@ -137,9 +139,23 @@ spec:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
default: false
dependencies:
- "camel:core"
- "camel:aws2-sqs"
- "github:apache.camel-kamelets:camel-kamelets-utils:main-SNAPSHOT"
- "camel:kamelet"
template:
beans:
- name: renameHeaders
type: "#class:org.apache.camel.kamelets.utils.headers.DuplicateNamingHeaders"
property:
- key: prefix
value: 'CamelAwsSqs'
- key: renamingPrefix
value: 'aws.sqs.'
- key: mode
value: 'filtering'
- key: selectedHeaders
value: 'CamelAwsSqsReceiptHandle,CamelAwsSqsMessageId'
from:
uri: "aws2-sqs:{{queueNameOrArn}}"
parameters:
Expand All @@ -156,4 +172,6 @@ spec:
delay: "{{delay}}"
greedy: "{{greedy}}"
steps:
- process:
ref: "{{renameHeaders}}"
- to: "kamelet:sink"