Skip to content

Latest commit

 

History

History
106 lines (96 loc) · 4.03 KB

File metadata and controls

106 lines (96 loc) · 4.03 KB

What is AsyncAPI?

What is AsyncAPI Initiative?

What are specification key concepts?

Basic

  • AsyncAPI is for describing the application interface, not the broker
  • EDA is not broker only, thus AsyncAPI is not only for broker-centric architectures
  • Channels are topics
  • Publish/subscribe operations

Flexibility

  • Protocol agnostic aka bindings feature. Like with MQTT when you connect to it, clientId must be provieded
  • Multiple message schema formats (schemaFormat) aka "Just reuse what you already have defined in other systems" -> AsyncAPI Schema, JSON Schema, OpenAPI, RAML DT, Avro
    //example message data - GOOD
    {
      "displayName": "Shrek from the swamp",
      "email": "shrek@swamp.com",
      "age": 39
    }
    //example message data - BAD
    {
      "displayName": "Shrek from the swamp",
      "email": "shrek@swamp.com",
      "age": "39y"
    }
    
    //json schema
    {
      "description" : "User information",
      "type" : "object",
      "additionalProperties": false,
      "properties" : {
        "displayName" : {
          "type" : "string"
        },
        "email" : {
          "type" : "string"
        },
        "age" : {
          "type" : "integer",
        }
     }
    }   
    
    //asyncapi schema
    {
      "description" : "**User** information",
      "type" : "object",
      "additionalProperties": false,
      "properties" : {
        "displayName" : {
          "type" : "string"
        },
        "email" : {
          "type" : "string"
        },
        "age" : {
          "type" : "integer",
        }
     }
    }   
    
    //avro
    {
      "type": "record",
      "name": "User",
      "namespace": "com.company",
      "doc": "User information",
      "fields": [
        {
          "name": "displayName",
          "type": "string"
        },
        {
          "name": "email",
          "type": "string"
        },
        {
          "name": "age",
          "type": "int"
        }
      ]
    }
    
  • Extensibility through x- properties. Useful when there is something not available in the spec, like specifying a response

Info structure optimization