Knative Source for Apache Camel Kamelet integrations¶
The IntegrationSource
is a Knative Eventing custom resource supporting selected Kamelets from the Apache Camel project. Kamelets allow users to connect to 3rd party system for improved connectivity, they can act as "sources" or as "sinks". Therefore the IntegrationSource
allows to consume data from external systems and forward them into Knative Eventing. The source is part of the Knative Eventing core installation.
Amazon Web Services¶
The IntegrationSource
supports a couple of AWS services through its aws
property, such as s3
, sqsq
or ddbStreams
.
Amazon credentials¶
For connecting to AWS the IntegrationSource
uses Kubernetes Secret
, present in the namespace of the resource. The Secret
can be created like:
```bash
kubectl -n <namespace> create secret generic my-secret --from-literal=aws.s3.accessKey=<accessKey> --from-literal=aws.s3.secretKey=<secretKey>
```
AWS S3 Source¶
Below is an IntegrationSource
to receive data from an Amazon S3 Bucket.
apiVersion: sources.knative.dev/v1alpha1
kind: IntegrationSource
metadata:
name: kamelet-source-aws
namespace: knative-samples
spec:
aws:
s3:
bucketNameOrArn: "arn:aws:s3:::my-bucket"
region: "eu-north-1"
auth:
secret:
ref:
name: "my-secret"
sink:
ref:
apiVersion: eventing.knative.dev/v1
kind: Broker
name: default
Inside of the aws.s3
object we define the name of the bucket (or arn) and its region. The credentials for the AWS service are referenced from the my-secret
Kubernetes Secret
More details about the Apache Camel Kamelet aws-s3-source.
AWS SQS Source¶
Below is an IntegrationSource
to receive data from AWS SQS.
apiVersion: sources.knative.dev/v1alpha1
kind: IntegrationSource
metadata:
name: kamelet-source-aws
namespace: knative-samples
spec:
aws:
sqs:
queueNameOrArn: "arn:aws:s3:::my-queue"
region: "eu-north-1"
auth:
secret:
ref:
name: "my-secret"
sink:
ref:
apiVersion: eventing.knative.dev/v1
kind: Broker
name: default
aws.sqs
object we define the name of the queue (or arn) and its region. The credentials for the AWS service are referenced from the my-secret
Kubernetes Secret
More details about the Apache Camel Kamelet aws-sqs-source.
AWS DynamoDB Streams¶
Below is an IntegrationSource
to receive events from Amazon DynamoDB Streams.
apiVersion: sources.knative.dev/v1alpha1
kind: IntegrationSource
metadata:
name: kamelet-source-aws
namespace: knative-samples
spec:
aws:
ddb-streams:
table: "my-table"
region: "eu-north-1"
auth:
secret:
ref:
name: "my-secret"
sink:
ref:
apiVersion: eventing.knative.dev/v1
kind: Broker
name: default
Inside of the aws.ddb-streams
object we define the name of the table and its region. The credentials for the AWS service are referenced from the my-secret
Kubernetes Secret
More details about the Apache Camel Kamelet aws-ddb-streams-source.
Timer Source¶
Produces periodic messages with a custom payload.
apiVersion: sources.knative.dev/v1alpha1
kind: IntegrationSource
metadata:
name: kamelet-source-timer
namespace: knative-samples
spec:
timer:
period: 2000
message: "Hello, Eventing Core"
sink:
ref:
apiVersion: eventing.knative.dev/v1
kind: Broker
name: default
Inside of the aws.ddb-streams
object we define the period
and the message that is send to the referenced sink
.
More details about the Apache Camel Kamelet timer-source.