A tool generate AsyncAPI yaml/json from Java code
APACHE-2.0 License
A lib which helps you generate asyncapi.yaml
from your Java code based on annotations.
pom.xml
<dependencies>
<dependency>
<groupId>lu.greenhalos</groupId>
<artifactId>j2asyncapi-annotation</artifactId>
<version>${j2asyncapi.version}</version>
</dependency>
<dependency>
<groupId>lu.greenhalos</groupId>
<artifactId>j2asyncapi-processor</artifactId>
<version>${j2asyncapi.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
ExampleBaseApplication.class
with a valid base class of yours e.g. your SpringBootApplication class with theDOCS_TARGET
to your needs.@RabbitListener
with the@AsyncApi
:class Listener {
@AsyncApi(
type = LISTENER, exchange = "exchange", routingKey = "routing.key", payload = ExampleListenerMessage.class,
description = "Description explaining exactly what happens here"
)
@RabbitListener(queues = "${some.long.path.to.the.queue.name}")
public void on(Message message) {
// do your stuff
}
}
DOCS_TARGET
.🥁 it is a simple a running:
./mvnw clean verify # or install in case you want to publish it to you local .m2 repository