47.3. Usage
47.3.1. Camel JBang usage 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
47.3.1.1. Prerequisites for JBang 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
- Install JBang.
You have executed the following command:
jbang app install camel@apache/camel
47.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
47.3.2. Knative Source 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
You can use the kafka-batch-source Kamelet as a Knative source by binding it to a Knative object.
kafka-batch-source-binding.yaml
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: kafka-batch-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: kafka-batch-source
properties:
bootstrapServers: "The Bootstrap Servers"
password: "The Password"
topic: "The Topic Names"
user: "The Username"
sink:
ref:
kind: Channel
apiVersion: messaging.knative.dev/v1
name: mychannel
47.3.3. Kafka Source 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
You can use the kafka-batch-source Kamelet as a Kafka source by binding it to a Kafka topic.
kafka-batch-source-binding.yaml
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: kafka-batch-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: kafka-batch-source
properties:
bootstrapServers: "The Bootstrap Servers"
password: "The Password"
topic: "The Topic Names"
user: "The Username"
sink:
ref:
kind: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic