Protocols

Protocols and implementations #

This article describes protocols for which go-asyncapi generates the additional protocol-specific code (besides the abstract code) to provide basic send-receive functionality. This includes:

  • Bindings
  • Message code for marshalling/unmarshalling from/to the protocol-specific envelope
  • Server connect helper functions, protocol-specific code in channels, etc.
  • Implementations based on popular Go libraries for the given protocol

AMQP #

AMQP

AMQP, or Advanced Message Queuing Protocol, is a standardized messaging protocol designed for exchanging messages between applications or services. It enables reliable communication across different platforms and languages, facilitating the building of distributed systems. AMQP defines a set of rules and formats for message queuing, ensuring interoperability and scalability in complex network environments.

Some of the most commonly used AMQP products include RabbitMQ, Apache Qpid, ActiveMQ and others.

Default library built in go-asyncapi is github.com/rabbitmq/amqp091-go.

FeatureProtocol specifics
Protocol nameamqp
ChannelExchange (outgoing) / Queue (incoming)
ServerAMQP broker
EnvelopeAMQP Message

Protocol bindings are described in https://github.com/asyncapi/bindings/tree/v3.0.0/amqp/README.md

Security scheme #

Security scheme for Operations is not supported

The following security schemes are supported by github.com/rabbitmq/amqp091-go:

Scheme typeComment
userPasswordPLAIN auth

Apache Kafka #

Apache Kafka

Apache Kafka is a distributed streaming platform that allows efficient process large volumes of real-time data. It enables applications to publish, subscribe to, store, and process streams of records in a fault-tolerant and scalable manner. Kafka is widely used for building real-time data pipelines, streaming analytics, and event-driven architectures.

Default library built in go-asyncapi is github.com/twmb/franz-go.

FeatureProtocol specifics
Protocol namekafka
ChannelTopic
ServerKafka broker
EnvelopeKafka Message

Protocol bindings are described in https://github.com/asyncapi/bindings/tree/v3.0.0/kafka/README.md

Security scheme #

The following security schemes are supported by github.com/twmb/franz-go:

Scheme typeComment
userPasswordSASL PLAIN auth

HTTP #

HTTP

HTTP, or Hypertext Transfer Protocol, is an application-layer protocol for transmitting hypermedia documents, such as HTML. It is the foundation of data communication on the World Wide Web and is used to exchange information between clients and servers.

HTTP follows a request-response model, where clients send requests to servers and servers respond with messages. It supports various methods, such as GET, POST, PUT, DELETE, and others, to perform different actions on resources.

Some of the most popular HTTP servers include Apache HTTP Server, Nginx, Microsoft IIS, and others.

Default library built in go-asyncapi is net/http.

FeatureProtocol specifics
Protocol namehttp
ChannelHTTP route
ServerHTTP server
EnvelopeHTTP request/response

Protocol bindings are described in https://github.com/asyncapi/bindings/tree/v3.0.0/http/README.md

Security scheme #

The following security schemes are supported by net/http:

Scheme typeComment
userPasswordHTTP Basic auth
apiKeyHTTP Basic auth

IP RAW sockets #

IP RAW sockets

IP RAW sockets, provide a way to send and receive data at the Internet Protocol (IP) level. They allow you to bypass the standard TCP/IP stack and interact directly with the network layer.

RAW sockets are used for low-level network operations, such as network scanning, packet crafting, and protocol development. They are commonly used by network administrators, security professionals, and developers to perform advanced network tasks.

Default library built in go-asyncapi is net.

FeatureProtocol specifics
Protocol nameip
ChannelIP peers pair info
ServerIP peer
EnvelopeIP packet

Bindings #

Server Bindings #

Does not support any server bindings.

Channel Bindings #

Does not support any channel bindings.

Operation Bindings #

Does not support any operation bindings.

Message Bindings #

Does not support any message bindings.

Security scheme #

Security scheme is not supported

MQTT v3 #

MQTT v3

MQTT, or Message Queuing Telemetry Transport, is a lightweight messaging protocol designed for constrained devices and low-bandwidth, high-latency, or unreliable networks. It is widely used in the Internet of Things (IoT) and mobile applications to enable communication between devices and servers.

MQTT follows a publish-subscribe model, where clients publish messages to topics and subscribe to receive messages from topics. It is known for its simplicity, efficiency, and reliability, making it an ideal choice for IoT applications and other scenarios with limited resources.

Some of the most popular MQTT brokers include Mosquitto, HiveMQ, EMQ X and others.

Default library built in go-asyncapi is github.com/eclipse/paho.mqtt.golang.

FeatureProtocol specifics
Protocol namemqtt
ChannelTopic
ServerMQTT broker
EnvelopeMQTT Message

Protocol bindings are described in https://github.com/asyncapi/bindings/tree/v3.0.0/mqtt/README.md

Security scheme #

Security scheme for Operations is not supported

The following security schemes are supported by github.com/rabbitmq/amqp091-go:

Scheme typeComment
userPasswordUsername/Password auth

MQTT v5 #

MQTT v5

MQTT v5 is the latest version of the Message Queuing Telemetry Transport (MQTT) protocol, which is a lightweight messaging protocol designed for constrained devices and low-bandwidth, high-latency, or unreliable networks. MQTT v5 introduces several enhancements and new features compared to its predecessor, MQTT v3, including improved error reporting, enhanced security options, and support for message expiry intervals.

Some of the most popular MQTT brokers include Mosquitto, HiveMQ, EMQ X and others.

Default library built in go-asyncapi is github.com/eclipse/paho.golang.

FeatureProtocol specifics
Protocol namemqtt5
ChannelTopic
ServerMQTT broker
EnvelopeMQTT Message

Protocol bindings are described in https://github.com/asyncapi/bindings/tree/v3.0.0/mqtt/README.md

Security scheme #

Security scheme for Operations is not supported

The following security schemes are supported by github.com/eclipse/paho.golang:

Scheme typeComment
userPasswordUsername/Password auth
apiKeyPassword-only auth

NATS #

NATS

NATS is a high-performance messaging system designed for cloud-native applications, microservices, and distributed systems. NATS supports various messaging patterns, including publish-subscribe, request-reply, and queue groups, making it a versatile choice for building modern applications. It also supports NATS Streaming (now known as JetStream), which provides durable message storage and advanced streaming capabilities.

Default library built in go-asyncapi is github.com/nats-io/nats.go.

FeatureProtocol specifics
Protocol namenats
ChannelSubject
ServerNATS server
EnvelopeNATS Message

Protocol bindings are described in https://github.com/asyncapi/bindings/blob/master/nats/README.md

Security scheme #

Security scheme for Operations is not supported

The following security schemes are supported by github.com/nats-io/nats.go:

Scheme typeComment
userPasswordUsername/Password auth
apiKeyToken auth

Redis #

Redis

Redis is an open-source, in-memory data structure store that can be used as a database, cache, and message broker. It supports various data structures such as strings, hashes, lists, sets, sorted sets, bitmaps, hyperloglogs, geospatial indexes, and streams. Redis is known for its high performance, scalability, and versatility, making it a popular choice for real-time applications, caching, and message queuing.

Default library built in go-asyncapi is github.com/redis/go-redis.

FeatureProtocol specifics
Protocol nameredis
ChannelServer connection
ServerRedis server
EnvelopeRedis Message

Protocol bindings are described in https://github.com/asyncapi/bindings/tree/v3.0.0/redis/README.md

Security scheme #

The following security schemes are supported by github.com/redis/go-redis:

Scheme typeComment
userPasswordAUTH command with username and password
apiKeyAUTH command with password

TCP #

TCP

TCP (Transmission Control Protocol) is a core protocol of the Internet Protocol Suite, responsible for establishing and maintaining connections between devices on a network. It ensures reliable, ordered, and error-checked delivery of data packets over IP networks.

Default library built in go-asyncapi is net.

FeatureProtocol specifics
Protocol nametcp
ChannelConnection
ServerTCP peer
EnvelopeTCP packet

Bindings #

Server bindings #

Does not support any server bindings.

Channel bindings #

Does not support any channel bindings.

Operation bindings #

Does not support any operation bindings.

Message bindings #

Does not support any message bindings

Security scheme #

Security scheme is not supported

UDP #

UDP

UDP (User Datagram Protocol) is a connectionless protocol that sends data packets, called datagrams, over the network without establishing a connection. It is faster and more efficient than TCP but does not guarantee the delivery of packets. It is used in applications where speed is more important than reliability, such as online games, video streaming, and voice over IP (VoIP).

Default library built in go-asyncapi is net.

FeatureProtocol specifics
Protocol nameudp
ChannelUDP peers pair info
ServerUDP peer
EnvelopeUDP datagram

Bindings #

Server bindings #

Does not support any server bindings.

Channel bindings #

Does not support any channel bindings.

Operation bindings #

Does not support any operation bindings.

Message bindings #

Does not support any message bindings.

Security scheme #

Security scheme is not supported

WebSocket #

WebSocket

WebSocket is a communication protocol that provides full-duplex communication channels over a single TCP connection. It is widely used in web applications to enable real-time communication between clients and servers. WebSocket allows for bidirectional communication, low latency, and efficient data transfer, making it an ideal choice for interactive applications, online games, chat applications, and other scenarios that require real-time updates.

WebSocket is supported by most modern web browsers and servers, and it is commonly used in conjunction with HTTP to establish a persistent connection between clients and servers.

Default library built in go-asyncapi is github.com/gobwas/ws.

FeatureProtocol specifics
Protocol namews
ChannelConnection
ServerWebsocket server
EnvelopeWebsocket Message

Protocol bindings are described in https://github.com/asyncapi/bindings/tree/v3.0.0/websockets/README.md

Security scheme #

The following security schemes are supported by github.com/gobwas/ws:

Scheme typeComment
userPasswordHTTP Basic auth
apiKeyHTTP Basic auth