Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: split hello world tutorial into two (send and receive) #2981

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

quetzalliwrites
Copy link
Member

@quetzalliwrites quetzalliwrites commented May 21, 2024

Resolves #993 and comment by @derberg via #993 (comment).

Summary by CodeRabbit

  • Documentation
    • Added two new tutorials:
      • "Receive 'Hello world' message": Guides users through setting up an application to consume messages following a "hello {name}" pattern.
      • "Send 'Hello world' message": Provides step-by-step instructions for creating an application that publishes messages with the specified format using an AsyncAPI specification.

@quetzalliwrites quetzalliwrites added 📑 docs area/docs Specify what technical area given issue relates to. Its goal is to ease filtering good first issues. labels May 21, 2024
@quetzalliwrites quetzalliwrites self-assigned this May 21, 2024
Copy link

netlify bot commented May 21, 2024

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit a168a51
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/67a5529865d6fa00080bba2c
😎 Deploy Preview https://deploy-preview-2981--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented May 21, 2024

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 36
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🟠 PWA 56

Lighthouse ran on https://deploy-preview-2981--asyncapi-website.netlify.app/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly change the folder for these files, as inside markdown.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks for the reminder!

@derberg
Copy link
Member

derberg commented Jun 18, 2024

what happens with https://github.com/asyncapi/website/blob/master/markdown/docs/tutorials/getting-started/hello-world.md tutorial? shouldn't one of new once replace it with same filename but different title (asking because of dead links)


The `operations` section is where you describe what the application is doing. Each operation has a unique identifier for example, `sendHello`.

In the above example, you see that the `Hello world application` is a producer sending the `sayHelloMessage` message from the `hello` channel. In other words, you can say that the `Hello world application` publishes the `hello` topic to `send` the `sayHelloMessage` message. That AsyncAPI document describes what the `Hello world application` is doing, not what others can do with it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In the above example, you see that the `Hello world application` is a producer sending the `sayHelloMessage` message from the `hello` channel. In other words, you can say that the `Hello world application` publishes the `hello` topic to `send` the `sayHelloMessage` message. That AsyncAPI document describes what the `Hello world application` is doing, not what others can do with it.
In the above example, you see that the `Hello world application` is a producer sending the `sayHelloMessage` message to the `hello` channel. In other words, you can say that the `Hello world application` `send` the `sayHelloMessage` message to the `hello` topic. That AsyncAPI document describes what the `Hello world application` is doing, not what others can do with it.

@@ -0,0 +1,120 @@
---
title: "Receive 'Hello world' message"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the only difference in this document is receive operation and there is a lot of repetition - is it intended? especially that app name is the same Hello world application. Shouldn't it be done like other tuturials for example for Kafka, where first tutorial would be about send message, and the one about receiving would be "extending" the send-one, where you extend the document with additional receive operation (of course still explaining these can be separate)

Copy link
Member Author

quetzalliwrites commented Jun 21, 2024

There would no longer be that link.

Instead, we would have two new links that help differentiate the two hello world tutorials in this section.

As for dead links, I will make sure to check for any in this PR too now that it's being reviewed.

Copy link
Member

derberg commented Jun 24, 2024

then we need redirect from old link to a new one, for external resources that link to the current document, to not cause dead links

@quetzalliwrites
Copy link
Member Author

Oh, right! I forgot, thanks for reminding me. smh 🤦‍♀️

Can you remind/tell me where I should be adding the redirect links? I remember before I did it for the spec docs, but this is the website repo and I'm unsure. 🫤

@derberg

Copy link
Member

derberg commented Jun 25, 2024

@sambhavgupta0705
Copy link
Member

/update

@akshatnema
Copy link
Member

@quetzalliwrites @derberg Any update on this PR?

Copy link

github-actions bot commented Feb 7, 2025

This pull request has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.

There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale label Feb 7, 2025
Copy link
Contributor

coderabbitai bot commented Feb 7, 2025

Walkthrough

Two new tutorial documents have been added. One document demonstrates building a consumer application that receives a "hello {name}" message via an AsyncAPI spec with a receiveHello operation. The other document outlines creating a producer application that sends a "hello {name}" message using an AsyncAPI spec with a sendHello operation. Both documents detail the AsyncAPI components such as the info, channels, and operations sections, emphasizing message structure validation via a regex pattern.

Changes

File(s) Change Summary
pages/docs/tutorials/getting-started/hello-world-receive-message.md, pages/docs/tutorials/…/hello-world-send-message.md Added new tutorial documents for handling "Hello world" messages. One tutorial guides on receiving messages (consumer with receiveHello operation) and the other on sending messages (producer with sendHello operation) using an AsyncAPI specification.

Sequence Diagram(s)

sequenceDiagram
    participant Producer as Producer Application
    participant Broker as AsyncAPI Broker
    Producer->>Broker: Execute sendHello operation with "hello {name}"
    Broker-->>Producer: (Optional) Acknowledge message publish
Loading
sequenceDiagram
    participant Broker as AsyncAPI Broker
    participant Consumer as Consumer Application
    Broker->>Consumer: Deliver "hello {name}" via receiveHello operation
    Consumer-->>Broker: (Optional) Acknowledge message receipt
Loading

Assessment against linked issues

Objective Addressed Explanation
Hello World Producer Tutorial (#993)

Poem

In a burrow of code I hop along,
Crafting messages with a happy song,
A producer's tale of hello in the air,
And a consumer listens with utmost care,
Hoping our specs make coding bright—
CodeRabbit cheers, day and night! 🐰✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Feb 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (99e65e6) to head (a168a51).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2981   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        20           
  Lines          732       732           
=========================================
  Hits           732       732           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (6)
pages/docs/tutorials/getting-started/hello-world-send-message.md (3)

52-70: Info Object Explanation and Versioning Note

The snippet clearly presents the info object. As a minor improvement, consider rephrasing the versioning note for brevity (for example, “It is recommended to update the version whenever changes are made.”).


94-94: Conciseness Suggestion for Channels Description

The sentence “The channels section of the specification houses all of the mediums where messages flow through.” can be streamlined by removing “of” (e.g., “...houses all mediums where messages flow through.”).

🧰 Tools
🪛 LanguageTool

[style] ~94-~94: Consider removing “of” to be more concise
Context: ...ls` section of the specification houses all of the mediums where messages flow through. Fo...

(ALL_OF_THE)


120-121: Punctuation for Clarity

Consider adding a comma after “identifier” in the sentence “Each operation has a unique identifier for example, sendHello” — it would read better as “Each operation has a unique identifier, for example, sendHello.”

pages/docs/tutorials/getting-started/hello-world-receive-message.md (3)

52-70: Info Object Explanation and Versioning Note

This snippet thoroughly explains the info object. As with the sending tutorial, consider rephrasing the versioning recommendation for brevity.


94-94: Conciseness Suggestion for Channels Description

As in the send tutorial, consider removing “of” to improve conciseness in the sentence describing the channels section.

🧰 Tools
🪛 LanguageTool

[style] ~94-~94: Consider removing “of” to be more concise
Context: ...ls` section of the specification houses all of the mediums where messages flow through. Fo...

(ALL_OF_THE)


[uncategorized] ~94-~94: Possible missing comma found.
Context: ... kinds of information flow through each channel similar to the analogy of TV channels. ...

(AI_HYDRA_LEO_MISSING_COMMA)


118-121: Punctuation for Clarity

A comma after “identifier” in the sentence “Each operation has a unique identifier for example, receiveHello” would enhance readability (e.g., “..., for example, receiveHello”).

🧰 Tools
🪛 LanguageTool

[uncategorized] ~118-~118: Possible missing comma found.
Context: ...n is doing. Each operation has a unique identifier for example, receiveHello. In the ab...

(AI_HYDRA_LEO_MISSING_COMMA)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 99e65e6 and a168a51.

📒 Files selected for processing (2)
  • pages/docs/tutorials/getting-started/hello-world-receive-message.md (1 hunks)
  • pages/docs/tutorials/getting-started/hello-world-send-message.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
pages/docs/tutorials/getting-started/hello-world-send-message.md

[style] ~72-~72: Consider shortening or rephrasing this to strengthen your wording.
Context: ...nded to change the version whenever you make changes to the API. <CodeBlock highlightedLines={...

(MAKE_CHANGES)


[style] ~94-~94: Consider removing “of” to be more concise
Context: ...ls` section of the specification houses all of the mediums where messages flow through. Fo...

(ALL_OF_THE)


[uncategorized] ~118-~118: Possible missing comma found.
Context: ...n is doing. Each operation has a unique identifier for example, sendHello. In the above...

(AI_HYDRA_LEO_MISSING_COMMA)

pages/docs/tutorials/getting-started/hello-world-receive-message.md

[style] ~72-~72: Consider shortening or rephrasing this to strengthen your wording.
Context: ...nded to change the version whenever you make changes to the API. <CodeBlock highlightedLines={...

(MAKE_CHANGES)


[style] ~94-~94: Consider removing “of” to be more concise
Context: ...ls` section of the specification houses all of the mediums where messages flow through. Fo...

(ALL_OF_THE)


[uncategorized] ~94-~94: Possible missing comma found.
Context: ... kinds of information flow through each channel similar to the analogy of TV channels. ...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~96-~96: Possible missing comma found.
Context: ...he given regular expression in a string format such as hello {name}. <CodeBlock hig...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~118-~118: Possible missing comma found.
Context: ...n is doing. Each operation has a unique identifier for example, receiveHello. In the ab...

(AI_HYDRA_LEO_MISSING_COMMA)

🔇 Additional comments (9)
pages/docs/tutorials/getting-started/hello-world-send-message.md (4)

1-4: YAML Frontmatter Validity

The header is well structured with a clear title and weight assigned. This frontmatter sets up the document correctly.


8-26: AsyncAPI Specification Example – Send Operation

This code block provides a complete AsyncAPI example for a producer application. The use of action: 'send' here correctly reflects the tutorial’s intent for sending messages.


30-48: Detailed Code Example – Full Document Illustration

The detailed code block reiterates the AsyncAPI document in a highlighted manner. It effectively reinforces the structure outlined above.


74-92: Additional Info Block Example

This section further illustrates the API’s detail and is clear in its presentation. No issues noted.

pages/docs/tutorials/getting-started/hello-world-receive-message.md (5)

1-4: YAML Frontmatter Validity

The header is correctly configured with a concise title and an appropriate weight, ensuring the document is properly identified in the navigation structure.


8-26: AsyncAPI Specification Example – Receive Operation

This code block provides a complete AsyncAPI example tailored for a consumer application. The operation receiveHello with action: 'receive' is correctly used here.


30-48: Detailed Code Example – Full Document Illustration

The highlighted example reaffirms the overall structure of the API specification. It clearly distinguishes the document’s components and is consistent with the receiving context.


74-92: Additional Info Block Example

This block well illustrates the essential detail of the API’s information. Everything appears in order.


98-116: Operation Details – Receive Context

The code block for the channels section correctly defines the receive operation (receiveHello) with action: 'receive', which aligns with the tutorial’s purpose for consuming messages.

Comment on lines +98 to +116
<CodeBlock highlightedLines={[13,14,15,16,17]}>
{`asyncapi: 3.0.0
info:
title: Hello world application
version: '0.1.0'
channels:
hello:
address: 'hello'
messages:
sayHelloMessage:
payload:
type: string
pattern: '^hello .+$'
operations:
sendHello:
action: 'receive'
channel:
$ref: '#/channels/hello'`}
</CodeBlock>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Operation Action Inconsistency

Within this highlighted example for the channels section, the sendHello operation mistakenly uses action: 'receive' instead of action: 'send'. Please update this to maintain consistency with the tutorial’s focus on sending messages.

Proposed change:

-    action: 'receive'
+    action: 'send'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<CodeBlock highlightedLines={[13,14,15,16,17]}>
{`asyncapi: 3.0.0
info:
title: Hello world application
version: '0.1.0'
channels:
hello:
address: 'hello'
messages:
sayHelloMessage:
payload:
type: string
pattern: '^hello .+$'
operations:
sendHello:
action: 'receive'
channel:
$ref: '#/channels/hello'`}
</CodeBlock>
<CodeBlock highlightedLines={[13,14,15,16,17]}>
{`asyncapi: 3.0.0
info:
title: Hello world application
version: '0.1.0'
channels:
hello:
address: 'hello'
messages:
sayHelloMessage:
payload:
type: string
pattern: '^hello .+$'
operations:
sendHello:
action: 'send'
channel:
$ref: '#/channels/hello'`}
</CodeBlock>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs Specify what technical area given issue relates to. Its goal is to ease filtering good first issues. 📑 docs stale
Projects
Status: Community PR under Review 🧐
Development

Successfully merging this pull request may close these issues.

[📑 Docs]: add new tutorial Hello World for producer application
6 participants