templates/bindings/core/caffeine-action-binding.yaml (47 lines of code) (raw):

- route: from: uri: "kamelet:timer-source" parameters: period: 10000 message: '{"foo":"bar"}' steps: - to: uri: "kamelet:json-deserialize-action" - to: uri: "log:info" - to: uri: "kamelet:insert-header-action" parameters: name: "caffeine-key" value: "my-key" - to: uri: "kamelet:insert-header-action" parameters: name: "caffeine-operation" value: "PUT" - to: uri: "kamelet:caffeine-action" parameters: cacheName: "my-cache" # extract the foo field from the body, cleaning the body - to: uri: "kamelet:extract-field-action" parameters: field: '{"foo"}' - to: uri: "log:info" - to: uri: "kamelet:insert-header-action" parameters: name: "caffeine-key" value: "my-key" - to: uri: "kamelet:insert-header-action" parameters: name: "caffeine-operation" value: "GET" # retrieve the json payload from the cache and put into the body - to: uri: "kamelet:caffeine-action" parameters: cacheName: "my-cache" - to: uri: "log:info"