Skip to content

Commit

Permalink
remove exercises from wrong place
Browse files Browse the repository at this point in the history
  • Loading branch information
quetzalliwrites authored Feb 20, 2024
1 parent be14e38 commit 45be13d
Showing 1 changed file with 1 addition and 66 deletions.
67 changes: 1 addition & 66 deletions 100-level-AsyncAPI-Intro/step2.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,71 +137,6 @@ components:
description: The chat message
```

Now it's time to help Chan establish a sophisticated communication system with Eve on Capuccinova. With your new expertise in AsyncAPI, you'll assist him in creating an AsyncAPI document from scratch.


#### Exercise 1: Create an AsyncAPI document


1. In the KillerCoda terminal, create a new file by typing `nano chan-to-capuccinova.yaml`.

2. Enter the following AsyncAPI document structure:
```yaml
asyncapi: 3.0.0
info:
title: Space Communication API
version: '1.0.0'
description: API for communication between Chan's spaceship and Capuccinova
servers:
production:
host: mqtt://localhost
protocol: mqtt
description: Production server for space communication
channels:
roomidchat:
address: chat/{roomId}
messages:
chatMessage:
name: ChatMessage
payload:
type: object
properties:
userId:
type: string
description: The ID of the user who sent the message
message:
type: string
description: The chat message
spacename:
type: string
description: The unique spacename identifier for the message
operations:
sendChatMessage:
action: 'send'
summary: Send a chat message to a specific room
channel:
$ref: '#/channels/roomidchat'
```

#### Exercise 2: Add new channel and define operations**

After successfully laying the groundwork for communication with Capuccinova, Chan is eager to extend his AsyncAPI document to include a channel for Brownieterra.

1. Run the command `nano chan-to-capuccinova.yaml` to edit Chan's document.
2. Add a channel for Brownieterra, specifying the channel name, its address, and parameters.
```yaml
brownieterra-chat:
description: Channel for sending messages to Brownieterra
address: brownieterra-chat/{spacename}
parameters:
spacename:
description: The unique spacename identifier for Brownieterra communication
schema:
type: string
```

## Request/reply
As Eve and Chan near the completion of their communication system setup, Eve takes a moment to elaborate on the request/reply pattern to Chan, emphasizing that it is a communication pattern rather than a separate component.
Expand Down Expand Up @@ -326,4 +261,4 @@ operations:

With the final pieces programmed and the communication system in place, Chan gets ready to return home.

Making a promise to stay in touch, Chan takes off in his spaceship back to Brownieterra.
Making a promise to stay in touch, Chan takes off in his spaceship back to Brownieterra.

0 comments on commit 45be13d

Please sign in to comment.