From 09899414ce7471285df973972e2df0f4ef80c14d Mon Sep 17 00:00:00 2001 From: AnimeshKumar923 Date: Sun, 29 Oct 2023 14:38:09 +0530 Subject: [PATCH 1/3] re-add `Servers tutorial` and change code snippet changes: - Re-added the `Severs tutorial` in the next-major-spec branch. - Changed the code snippet to match v3. --- .../docs/tutorials/getting-started/servers.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 pages/docs/tutorials/getting-started/servers.md diff --git a/pages/docs/tutorials/getting-started/servers.md b/pages/docs/tutorials/getting-started/servers.md new file mode 100644 index 000000000000..59796f75cf39 --- /dev/null +++ b/pages/docs/tutorials/getting-started/servers.md @@ -0,0 +1,59 @@ +--- +title: "Servers" +date: 2019-04-03T10:56:52+01:00 +menu: + docs: + parent: 'getting-started' +weight: 110 +--- + +In the previous lesson, you learned how to create the definition of a simple [Hello World application](/docs/getting-started/hello-world). Let's take it from there. + +In this article, you'll learn how to add `servers` to your AsyncAPI document. Adding and defining servers is useful, because it specifies where and how to connect. The connection facilitates where to send and receive messages. + + +{`asyncapi: 3.0.0 +info: + title: Hello world application + version: '0.1.0' + +servers: + production: + host: broker.mycompany.com + protocol: amqp + description: This is "My Company" broker. + +channels: + hello: + address: 'hello' + messages: + sayHelloMessage: + payload: + type: string + pattern: '^hello .+$' + +operations: + receiveHello: + action: 'receive' + channel: + $ref: '#/channels/hello'`} + + +You've now added a new section called `servers` in your AsyncAPI document. + +You might have noticed that our example mentions `amqp`. This protocol is very common and was popularized by RabbitMQ (among others). We picked `amqp` for our example, but you can use any protocol. The most common protocols used are `mqtt` (widely adopted by the Internet of Things and mobile apps), `kafka` (popular for its streaming solution), `ws` (WebSockets are frequently used in browsers), and `http` (used in HTTP streaming APIs). + + + +The `servers` section defines where your application should connect to start sending and receiving messages. + +1. If you are using a broker-centric architecture such as Kafka or RabbitMQ, usually you specify the URL of the broker. +2. If you have the classic client-server model such as for REST APIs, then your `server` should be the URL of the server. + + + +## Conclusion + +Now you know where `Hello world application` connects to and you can start receiving `hello {name}` messages. + +In the next chapter, you'll learn how to add security requirements to your server. From 780b7e069f85bd4a6900408d5a818be8e6fb3fc0 Mon Sep 17 00:00:00 2001 From: Animesh Kumar Date: Thu, 9 Nov 2023 19:26:51 +0530 Subject: [PATCH 2/3] Update pages/docs/tutorials/getting-started/servers.md applied suggestion from: https://github.com/asyncapi/website/pull/2275#discussion_r1387723300 Co-authored-by: Lukasz Gornicki --- pages/docs/tutorials/getting-started/servers.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/pages/docs/tutorials/getting-started/servers.md b/pages/docs/tutorials/getting-started/servers.md index 59796f75cf39..df6e1eec5ec9 100644 --- a/pages/docs/tutorials/getting-started/servers.md +++ b/pages/docs/tutorials/getting-started/servers.md @@ -16,13 +16,11 @@ In this article, you'll learn how to add `servers` to your AsyncAPI document. Ad info: title: Hello world application version: '0.1.0' - servers: production: host: broker.mycompany.com protocol: amqp description: This is "My Company" broker. - channels: hello: address: 'hello' @@ -31,7 +29,6 @@ channels: payload: type: string pattern: '^hello .+$' - operations: receiveHello: action: 'receive' From fcf0eb9d249ea2e99caabcaa328a63af37760f54 Mon Sep 17 00:00:00 2001 From: Alejandra Quetzalli Date: Fri, 10 Nov 2023 13:56:42 -0800 Subject: [PATCH 3/3] tw editorial fixes --- pages/docs/tutorials/getting-started/servers.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pages/docs/tutorials/getting-started/servers.md b/pages/docs/tutorials/getting-started/servers.md index df6e1eec5ec9..6bca604ebe62 100644 --- a/pages/docs/tutorials/getting-started/servers.md +++ b/pages/docs/tutorials/getting-started/servers.md @@ -9,7 +9,7 @@ weight: 110 In the previous lesson, you learned how to create the definition of a simple [Hello World application](/docs/getting-started/hello-world). Let's take it from there. -In this article, you'll learn how to add `servers` to your AsyncAPI document. Adding and defining servers is useful, because it specifies where and how to connect. The connection facilitates where to send and receive messages. +In this tutorial, you'll learn how to add `servers` to your AsyncAPI document. Adding and defining servers is useful because it specifies where and how to connect. The connection facilitates where to send and receive messages. {`asyncapi: 3.0.0 @@ -38,19 +38,19 @@ operations: You've now added a new section called `servers` in your AsyncAPI document. -You might have noticed that our example mentions `amqp`. This protocol is very common and was popularized by RabbitMQ (among others). We picked `amqp` for our example, but you can use any protocol. The most common protocols used are `mqtt` (widely adopted by the Internet of Things and mobile apps), `kafka` (popular for its streaming solution), `ws` (WebSockets are frequently used in browsers), and `http` (used in HTTP streaming APIs). +You might have noticed that our example mentions `amqp`, a very common protocol that was popularized by RabbitMQ (among others). While our example uses `amqp`, you can use any protocol. The most common protocols used are `mqtt` (widely adopted by the Internet of Things and mobile apps), `kafka` (popular for its streaming solution), `ws` (WebSockets are frequently used in browsers), and `http` (used in HTTP streaming APIs). The `servers` section defines where your application should connect to start sending and receiving messages. -1. If you are using a broker-centric architecture such as Kafka or RabbitMQ, usually you specify the URL of the broker. +1. If you are using a broker-centric architecture such as Kafka or RabbitMQ, specify the broker URL. 2. If you have the classic client-server model such as for REST APIs, then your `server` should be the URL of the server. ## Conclusion -Now you know where `Hello world application` connects to and you can start receiving `hello {name}` messages. +Now you know where the `Hello world application` connects to, and you can start receiving `hello {name}` messages. -In the next chapter, you'll learn how to add security requirements to your server. +In the next section, you'll learn how to add security requirements to your server.