3.3. Usage
3.3.1. Camel JBang usage リンクのコピーリンクがクリップボードにコピーされました!
3.3.1.1. Prerequisites for JBang リンクのコピーリンクがクリップボードにコピーされました!
- Install JBang.
You have executed the following command:
jbang app install camel@apache/camel
3.3.1.2. Running a route with JBang リンクのコピーリンクがクリップボードにコピーされました!
Suppose you have a file named route.yaml with this content:
- route:
from:
uri: "kamelet:timer-source"
parameters:
period: 10000
message: 'test'
steps:
- to:
uri: "kamelet:log-sink"
You can now run it directly through the following command.
camel run route.yaml
3.3.2. Knative Action リンクのコピーリンクがクリップボードにコピーされました!
You can use the avro-serialize-action Kamelet as an intermediate step in a Knative binding.
avro-serialize-action-binding.yaml
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: avro-serialize-action-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: timer-source
properties:
message: '{"first":"Ada","last":"Lovelace"}'
steps:
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: json-deserialize-action
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: avro-serialize-action
properties:
schema: "{\"type\": \"record\", \"namespace\": \"com.example\", \"name\": \"FullName\", \"fields\": [{\"name\": \"first\", \"type\": \"string\"},{\"name\": \"last\", \"type\": \"string\"}]}"
sink:
ref:
kind: Channel
apiVersion: messaging.knative.dev/v1
name: mychannel
3.3.3. Kafka Action リンクのコピーリンクがクリップボードにコピーされました!
You can use the avro-serialize-action Kamelet as an intermediate step in a Kafka binding.
avro-serialize-action-binding.yaml
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: avro-serialize-action-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: timer-source
properties:
message: '{"first":"Ada","last":"Lovelace"}'
steps:
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: json-deserialize-action
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: avro-serialize-action
properties:
schema: "{\"type\": \"record\", \"namespace\": \"com.example\", \"name\": \"FullName\", \"fields\": [{\"name\": \"first\", \"type\": \"string\"},{\"name\": \"last\", \"type\": \"string\"}]}"
sink:
ref:
kind: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic