docs: rewrite Java template tutorial to AsyncAPI v3
Description
Rewrites the "Creating a template – Java" tutorial to use AsyncAPI v3.
Changes made:
- Updates AsyncAPI document from v2.6.0 to v3.0.0
- Replaces
url:withhost:in servers section - Migrates TopicFunction to use operations API instead of channels API
- Renames
getTopicstogetTopicsFromOperations - Updates
index.jsto useasyncapi.operations().filterByReceive() - Updates server URL to use
server.host() - Fixes duplicated "generated generated" text in output logs
Related issue
Resolves #1828
Summary by CodeRabbit
- Documentation
- Updated Java tutorial and examples to AsyncAPI v3 format and refreshed embedded examples.
- New Features
- Template now generates topic methods from v3 operations and uses server information for broker URL generation in the generated client.
- Bug Fixes
- Fixed duplicated console/log output in the example client and corrected end-of-file newline in the tutorial.
⚠️ No Changeset found
Latest commit: 6222fcc887cac74a54d70e0cd74de3e566ee664c
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Updated the Java template tutorial to AsyncAPI v3 and generator v2: examples, template wiring, and TopicFunction now use AsyncAPI v3 operations and server APIs; example YAML and package.json updated; duplicated log text and EOF newline fixes applied. (≤50 words) 🎯 3 (Moderate) | ⏱️ ~25 minutes ✏️ Tip: You can configure your own custom pre-merge checks in the settings.📝 Walkthrough
Walkthrough
Changes
Cohort / File(s)
Summary
Generator Java tutorial
apps/generator/docs/generator-template-java.mdRewrote examples to AsyncAPI v3 and generator v2: switched from channel-based to operations-based API (
TopicFunction({ operations }), getTopicsFromOperations(operations)), updated topic extraction to use op.channel().address() and op.id(), updated template wiring to use asyncapi.operations() and const server = asyncapi.server(params.server), changed generated Client.java broker URL construction to use server.host(), bumped generator.apiVersion / version range in package.json examples, migrated embedded AsyncAPI YAML to asyncapi: 3.0.0, fixed duplicated log text in TestClient.java snippet, removed an unused import, and corrected EOF newline.Estimated code review effort
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name
Status
Explanation
Description Check
✅ Passed
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
✅ Passed
The title clearly summarizes the main change—rewriting the Java template tutorial to use AsyncAPI v3. It follows Conventional Commits format with the 'docs:' prefix and uses imperative mood.
Linked Issues check
✅ Passed
The PR successfully addresses all objectives from issue
#1828: updates AsyncAPI document from v2.6.0 to v3.0.0, migrates template code to use v3 operations API, and aligns with other language tutorials.
Out of Scope Changes check
✅ Passed
All changes are directly related to the stated objectives: AsyncAPI v3 migration, operations API usage, server URL access updates, and duplicate text fix are all in scope.
Docstring Coverage
✅ Passed
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
🚀 Docs preview deployed Below link points directly to the generator docs preview. May the force be with you! → https://69e981e4f0f57e8cf860f637--asyncapi-website.netlify.app/docs/tools/generator
/u
and please make sure that your changes to AsyncAPI YAML are exactly the same as in the similar tutorial but python one
Thanks for the review @derberg! Will fix all the issues shortly
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
hello @derberg fixed all three issues: updated apiVersion to v2 and generator range to >=2.0.0 <3.0.0 removed double filterByReceive() in index.js, filtering now happens only inside TopicFunction.js changed action: send to action: receive in AsyncAPI YAML
@wei123-web do you have repo where we can see the test project? where you prove you went through the final tutorial, created project basing on instructions and made sure it is working?
if you look in some of the comments, they indicate that template created with this tutorial would not work. It is important that after your changes you go through tutorial, create template by copy/paste and config generated code works
if you look in some of the comments, they indicate that template created with this tutorial would not work. It is important that after your changes you go through tutorial, create template by copy/paste and config generated code works
Hi @derberg! I will fix all the issues you mentioned, test the full tutorial end to end, and update the YAML to match the Python tutorial shortly!
any news @wei123-web