asyncapi Binding
Bindingasyncapiclientproxyserver
asyncapi Binding
Defines a binding with asyncapi
spec, with server
or proxy
or client
behavior.
client
The client
kind asyncapi
binding creates composite of kafka
or mqtt
or http
, and tls
, tcp
bindings with client kind and adapts AsyncAPI streams to Kafka/MQTT/HTTP streams.
asyncapi_client:
type: asyncapi
kind: client
options:
specs:
my-kafka-api-spec:
catalog:
my_catalog:
subject: petstore
version: latest
tcp:
host: localhost
port:
- 9092
proxy
The proxy
kind asyncapi
binding creates composite of mqtt-kafka
binding with proxy kind mapping MQTT streams to Kafka streams.
asyncapi_proxy:
type: asyncapi
kind: proxy
options:
specs:
my-mqtt-api-spec:
catalog:
my_catalog:
subject: mqtt-streetlights
version: latest
my-kafka-api-spec:
catalog:
my_catalog:
subject: kafka-streetlights
version: latest
mqtt-kafka:
channels:
sessions: mqttSessions
retained: mqttRetained
messages: mqttMessages
routes:
- when:
- api-id: my-mqtt-api-spec
operation-id: sendEvents
exit: asyncapi_client
with:
api-id: my-kafka-api-spec
operation-id: toSensorData
- when:
- api-id: my-mqtt-api-spec
operation-id: receiveEvents
exit: asyncapi_client
with:
api-id: my-kafka-api-spec
operation-id: onSensorData
server
The server
kind asyncapi
binding creates composite of tcp
, tls
, and mqtt
or http
bindings with server kind and adapts MQTT/HTTP streams to AsyncAPI streams.
mqtt_asyncapi_server:
type: asyncapi
kind: server
options:
specs:
my-mqtt-api-spec:
catalog:
my_catalog:
subject: mqtt-streetlights
version: latest
exit: south_kafka_proxy