Skip to main content

Quickstart

The following instructions are for Kafka services - other protocols are almost the same. Check out the example project for complete examples.

1. Add dependencies

Add the following dependencies:

dependencies {
// Provides the documentation API
implementation 'io.github.springwolf:springwolf-kafka:1.8.0'

// Provides the UI - optional (recommended)
runtimeOnly 'io.github.springwolf:springwolf-ui:1.8.0'
}

Latest version: Maven Central

2. Configure properties

Add the following to your application.properties:

springwolf.docket.base-package=io.github.springwolf.example.consumers

springwolf.docket.info.title=${spring.application.name}
springwolf.docket.info.version=1.0.0

springwolf.docket.servers.kafka-server.protocol=kafka
springwolf.docket.servers.kafka-server.host=${kafka.bootstrap.servers:localhost:29092}

Make sure to change the value of springwolf.docket.base-package to the package containing your listeners, so that Springwolf will automatically pick them up.

3. View the docs

Start the application and open the URLs in your browser:

If you configured a different context path in your application, make sure to prepend it to Springwolf URLs: <host>:<port>/<context-path>/springwolf/asyncapi-ui.html

4. Next steps