To get started with the AsyncAPI Toolkit, simply use the dedicated wizard in the New Project
dialog:
Select AsyncAPI Project, set a project name, and continue.
After that, select a project template. We recommend you to start with the Streetlights API Example Project. The Streetlights API Example Project template contains a fully working example demonstrating the capabilities of the framework.
Finally, the wizard can be completed.
After that, a new Maven project with the following contents will appear in the workspace.
Pay special attention to the following files:
-
src/main/java/streetlights/StreetlightsAPI.asyncapi
is an example specification (see below) of an API using the JSON format of the AsyncAPI specification. Code and other resourcs in thegen
directory will be generated from the specification contained in this file. -
src/main/java/main/MainExample.java
is an example program demonstrating how to use the generated code, which provides an internal DSL based on fluent APIs to generate messages, and to publish and subscribe them. -
src/test/java/main/TestMainExample.java
is an example test suite that uses an embedded MQTT server to show how theMainExample.java
class can be executed.