Skip to content

Commit

Permalink
docs: add protocol concepts doc (#1013)
Browse files Browse the repository at this point in the history
Co-authored-by: Alejandra Quetzalli <[email protected]>
  • Loading branch information
nelsonmic and quetzalliwrites authored Dec 6, 2022
1 parent 05f0514 commit 02a1a6d
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions pages/docs/concepts/protocol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: Protocol
weight: 25
---


## What is a protocol?
A protocol is a set of rules that specifies how information is exchanged between applications and/or servers.

Protocol examples:
* [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket)
* [HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP)
* [Kafka](https://kafka.apache.org/)
* [MQTT](https://mqtt.org/)

## Why do we need protocols?
Whenever a producer detects a state change (events) and publishes those events as messages, a protocol carries those messages to the channel and then to a consumer. Protocol plays a vital role in message transmission.

```mermaid
sequenceDiagram
Publisher->>+Broker: PUBLISH(QoS0,Msg)
Broker->>+Subscriber: PUBLISH(QoS0,Msg)
Publisher->>+Publisher: Delete(Msg)
```

The diagram above depicts the message exchange flow from `producer` to `broker` to `consumer` using the MQTT protocol with QoS0 (quality of service 0). This means that information exchanged from `producer` to `broker` to `consumer` is delivered at most once.

The quality of service information rule is specified on a protocol level. Broker implementations and other involved actors must act accordingly.

In AsyncAPI documents, all protocol-specific details that the application follows can be described using [bindings](/docs/reference/specification/v2.5.0#definitionsBindings).

<DocsButton
suggestions={[
{
href:'/docs/concepts/application',
type: 'back',
title: 'Application',
},
{
href:'/docs/tutorials',
type: 'next',
title: 'Tutorials - Overview',
}
]}
/>

0 comments on commit 02a1a6d

Please sign in to comment.