Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/greenhalos/j2asyncapi
https://github.com/greenhalos/j2asyncapi
asyncapi asyncapi-tooling asyncapi-tools java java11
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/greenhalos/j2asyncapi
- Owner: greenhalos
- License: apache-2.0
- Created: 2022-01-27T19:38:02.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-09-20T01:58:23.000Z (4 months ago)
- Last Synced: 2024-09-28T23:20:57.112Z (4 months ago)
- Topics: asyncapi, asyncapi-tooling, asyncapi-tools, java, java11
- Language: Java
- Homepage:
- Size: 323 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# j2asyncapi
A lib which helps you generate `asyncapi.yaml` from your Java code based on annotations.
## How to use
1. Include the dependencies in your `pom.xml`
```xml
lu.greenhalos
j2asyncapi-annotation
${j2asyncapi.version}
lu.greenhalos
j2asyncapi-processor
${j2asyncapi.version}
test
```
2. Copy [this test](./j2asyncapi-example/src/test/java/lu/greenhalos/j2asyncapi/example/AsyncApiGeneratorTest.java)
from this Repository to your code base
3. Change `ExampleBaseApplication.class` with a valid base class of yours e.g. your SpringBootApplication class with the
main method.
4. Change the constant `DOCS_TARGET` to your needs.
5. Annotate a method which is a publisher e.g. a methode which is already annotated with `@RabbitListener` with the
j2asyncapi annotation `@AsyncApi`:
```java
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
}
}
```
6. Run the copied test. The resulting asyncapi.yml is generated to your `DOCS_TARGET`.## How to build
🥁 it is a simple a running:
```shell
./mvnw clean verify # or install in case you want to publish it to you local .m2 repository
```# TODOS
* @JsonIgnore
* process java.util.Locale
* Statistics about schemas