#
# Apache Camel AWS Kinesis Source
#
apiVersion: sources.knative.dev/v1alpha1
kind: CamelSource
metadata:
  name: camel-aws-kinesis-source
spec:
  source:
    integration:
      configuration:
        - type: secret
          value: aws-kinesis
      dependencies:
        # Needed for the json part on the flow/steps below
        - camel:jackson
        # Needed for the AWS Kinesis component
        - camel:camel-aws-kinesis
        - mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-cbor/2.10.4
    flow:
      from:
        # On the URI below, the Kinesis stream named 'stream' can be adjusted
        # to any value suitable in your scenario (ie.: aws-kinesis:my-stream-name)
        uri: aws-kinesis:stream
        parameters:
          secretKey: "{{aws.kinesis.secretKey}}"
          accessKey: "{{aws.kinesis.accessKey}}"
          region: "{{aws.kinesis.region}}"
        steps:
        - to: "log:received?showAll=true&multiline=true"
        - marshal:
            json: {}
  sink:
    ref:
      apiVersion: messaging.knative.dev/v1beta1
      kind: InMemoryChannel
      name: aws-kinesis
