Skip to content

jabrena/asyncapi-poc

Repository files navigation

Async API POC

A POC to review Async API Spec and some tools related.

Goals

  • Learn to define Async API Specs
  • Learn to generate documentation from Async API Specs
  • Learn to use Spectral for Async API
  • Learn to define a Spectral ruleset for Async API Specs
  • Learn to use Microcks
  • Learn to use Testcontainers support for Microcks
  • Learn to use Maven/Gradle plugin for Async API

Async API examples

cd specs

Microcks

https://microcks.io/

Microcks is now able to import AsyncAPI definitions for enriching the API catalogs with Event typed APIs. When set up accordingly, it is also able to mock the API by publishing samples messages on a dedicated message broker destination.

cd microcks
docker-compose up -d
open http://localhost:8080
docker-compose down

Async API Generator

https://www.asyncapi.com/tools/generator

Async API Generator Templates:

@asyncapi/java-template	Generates Java JMS application	click here
@asyncapi/java-spring-template	Generates Java Spring service	click here
@asyncapi/java-spring-cloud-stream-template	Generates Java Spring Cloud Stream service	click here
@asyncapi/html-template	Generates HTML documentation site	click here
@asyncapi/markdown-template	Generates documentation in Markdown file

How to:

# Move to a Script executed at codespaces level.
sudo apt update
sudo apt install nodejs npm
nodejs --version
npm --version
sudo npm install -g @asyncapi/generator

ag --help
sudo ag ./specs/confluent-example-asyncapi.yaml @asyncapi/html-template -o ./docs
sudo ag ./specs/hello-world-asyncapi.yaml @asyncapi/html-template -o examples/html-example
sudo ag ./specs/hello-world-asyncapi.yaml @asyncapi/markdown-template -o examples/markdown-example
sudo ag ./specs/hello-world-asyncapi.yaml @asyncapi/java-spring-template -o examples/spring-example
sudo ag ./specs/hello-world-asyncapi.yaml @asyncapi/java-spring-cloud-stream-template -o examples/spring-cloud-stream-example

sdk install java 20-tem
sdk use java 20-tem
jwebserver -p 9000 -d "$(pwd)/docs/"
sdk env install
sdk env

References

About

A POC to review Async API Spec and some tools related.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published