# example_for_kamelet_doc
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
  name: caffeine-action-pipe
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: timer-source
    properties:
      message: '{"foo":"bar"}'
      period: 10000
  steps:
  - ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: json-deserialize-action
  - ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: log-sink
  - ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: insert-header-action
    properties:
      name: "caffeine-key"
      value: "my-key"
  - ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: insert-header-action
    properties:
      name: "caffeine-operation"
      value: "PUT"
  - ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: caffeine-action
    properties:
      cacheName: "my-cache"
  # extract the foo field from the body, cleaning the body
  - ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: extract-field-action
    properties:
      field: '{"foo"}'
  - ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: log-sink
  - ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: insert-header-action
    properties:
      name: "caffeine-key"
      value: "my-key"
  - ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: insert-header-action
    properties:
      name: "caffeine-operation"
      value: "GET"
  # retrieve the json payload from the cache and put into the body
  - ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: caffeine-action
    properties:
      cacheName: "my-cache"
  sink:
    ref:
      kind: KafkaTopic
      apiVersion: kafka.strimzi.io/v1beta1
      name: my-topic
