Introduction To AsyncAPI For Apache Kafka

Transcription

Introduction toAsyncAPI forApache KafkaLorna Mitchell, Aiven

Meet Apache Kafka"Apache Kafka is an open-source distributed eventstreaming platform" - https://kafka.apache.org Designed for data streaming Real-time data for finance and industry Very scalable to handle large datasets Distributed log platform, each channel is a "topic"and has "partitions"@aiven io @lornajane

Kafka ArchitecturesProducers send data, Consumers receive it.@aiven io @lornajane

AsyncAPIOpen standard for describing event-driven anddata streaming systems.

AsyncAPI Website: https://asyncapi.com Open YAML/JSON standard describes message-basedsystems Supports Apache Kafka, MQTT, AMQP, WS . Tools to generate docs, code and more@aiven io @lornajane

Why use AsyncAPI?Describe your event-driven systems in a clear andreusable way Design-first and clear contracts between systems Clearly track changes in a text-based description Seamless integrations with other systems Enclose existing payload descriptions (CloudEvents,Avro) within AsyncAPI@aiven io @lornajane

Generated Docs@aiven io @lornajane

AsyncAPI Descriptions

AsyncAPI StructureTop-level elements: asyncapi and id info servers channels tags components@aiven io @lornajane

Info SectionValuable metadata is held in info.info:title: Thingum Industries Sensorsdescription: Keeping the factory and all the machines running nicelyversion: 1.0.0contact:name: Lornaemail: lornajane@aiven.iourl: :name: Apache 2.0url: ven io @lornajane

Channels SectionMain operations are described herechannels:door-sensor:description: Door sensors (external and internal)subscribe:operationId: DoorSensordescription: Open/closed state information from the doors.tags:- name: sensorbindings:kafka:clientId:type: stringmessage: ref: '#/components/messages/DoorData'@aiven io @lornajane

ref Reusable ContentRefer to content in the components sectionmessage: ref: '#/components/messages/DoorData'Useful for reuse and readability.We can also refer to other files:message: ref: @aiven io @lornajane

Components SectionA collection of reusable componentscomponents:messages:DoorData:name: door-sensor-datatitle: Door Sensor Readingdescription: Door sensor datapayload:type: objectproperties:location:type: stringstate:enum: ["open", "closed"]@aiven io @lornajane

AsyncAPI Tools

AsyncAPI PlaygroundPlayground: https://playground.asyncapi.io/@aiven io @lornajane

Use Your Editor@aiven io @lornajane

Generate DocumentationGenerator: https://www.asyncapi.com/generator@aiven io @lornajane

Generate CodeThe same generator can do more than HTML output.Generate code in Java, Python or NodeJS - or add yourown template.ag asyncapi.yaml @asyncapi/nodejs-template \-o nodejs -p server productionnpm installNODE ENV production npm start@aiven io @lornajane

Tools Landscape Playground: https://playground.asyncapi.io Generator: https://www.asyncapi.com/generator Microcks: https://microcks.io/ Spectral: https://stoplight.io/open-source/spectral/ view@aiven io @lornajane

AsyncAPI and YouOpen standards, seamless integrations

ResourcesApache Kafka: https://kafka.apache.comAsyncAPI: https://asyncapi.comAiven: https://aiven.io - try the free trialExamples: s: https://microcks.io/API Specifications Conference (Sep 28-29)AsyncAPI Hackathon (Oct 1-31) Conference (Nov 16-18)https://conference.asyncapi.com@aiven io @lornajane

Meet Apache Kafka "Apache Kafka is an open-source distributed event streaming platform" - https://kafka.apache.org Designed for data streaming Real-time data for finance and industry Very scalable to handle large datasets Distributed log platform, each channel