-
-
Notifications
You must be signed in to change notification settings - Fork 786
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: fix incorrect message reference in operation object example #3700
Conversation
WalkthroughThis pull request includes two factual updates to the AsyncAPI documentation. First, it revises the location of the Changes
Sequence Diagram(s)sequenceDiagram
participant Publisher
participant Broker
participant Consumer
Publisher->>Broker: Publish message with correlation ID
Broker->>Consumer: Deliver message with correlation ID
Consumer->>Consumer: Process message and log correlation ID
Suggested labels
Suggested reviewers
Poem
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
✅ Deploy Preview for asyncapi-website ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3700 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 20 20
Lines 732 732
=========================================
Hits 732 732 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
markdown/docs/tutorials/correlation-ids.md (2)
35-78
: AsyncAPI YAML Example AccuracyThe YAML example accurately demonstrates an AsyncAPI specification for an order processing service. It clearly defines the channel (
order/created
), message details (headers and payload), and even provides an example correlation ID.Suggestion:
Consider adding a brief inline comment or note (perhaps just before the code block) to remind users that this example follows the AsyncAPI 3.0.0 format, which might help those new to the spec.
81-156
: Node.js Implementation Example ReviewThe practical Node.js example is well-crafted. It shows how to:
- Establish an AMQP connection using
amqplib
- Generate a UUID for the correlation ID
- Publish a message with the correlation ID in the headers
- Consume messages and log the correlation ID for tracing
While the sample is clear and instructional, you might consider wrapping asynchronous operations in try/catch blocks for production-grade error handling. Since this is a tutorial, the current level of error handling is acceptable, but adding a note about robust error management in real-world applications can further enhance the guidance.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
markdown/docs/concepts/asyncapi-document/structure.md
(1 hunks)markdown/docs/tutorials/correlation-ids.md
(1 hunks)
⏰ Context from checks skipped due to timeout of 180000ms (6)
- GitHub Check: Redirect rules - asyncapi-website
- GitHub Check: Header rules - asyncapi-website
- GitHub Check: Pages changed - asyncapi-website
- GitHub Check: Test NodeJS PR - windows-latest
- GitHub Check: Test NodeJS PR - macos-13
- GitHub Check: Lighthouse CI
🔇 Additional comments (4)
markdown/docs/tutorials/correlation-ids.md (3)
1-5
: Front Matter and Metadata OverviewThe front matter block is well-structured and clearly defines the document's title, description, and weight. This metadata sets the context nicely for the tutorial.
7-9
: Clear Introduction SectionThe "Introduction" section succinctly explains the concept of correlation IDs and their importance in event-driven architectures. This sets an appropriate stage for the detailed content that follows.
158-194
: Best Practices and Visual AidsThe "Best Practices" section, complemented by the Mermaid sequence diagram, provides valuable guidance on generating, propagating, and utilizing correlation IDs. The inclusion of practical tips (e.g., generating IDs early, consistently propagating them, and incorporating them into logs) is very useful for users.
markdown/docs/concepts/asyncapi-document/structure.md (1)
461-463
: Message Reference Update ValidationThe updated reference for the
userSignedUp
message—from#/components/messages/userSignedUp
to#/channels/user/messages/userSignUp
—correctly aligns with the AsyncAPI guidelines. This change ensures that the message is now correctly associated with the channel context rather than the components object. Great fix that addresses the issue raised in the bug report.
Fixes [Docs Bug 🐞 report]: operation object example incorrect #3177
The current example in the documentation references a message from the Components Object, which breaks the rule that messages in an operation must reference messages defined in the channel. This PR fixes the example to reference the message from the channel's messages instead.
channels
field example to reference the message from the channel's messages.Before (Incorrect)
$ref: '#/components/messages/userSignUp'
After (Correct)
$ref: '#/channels/user/messages/userSignUp'
Summary by CodeRabbit