...
springwolf-ui adds a web UI, much like that of Springfox, and allows easy publishing of auto-generated payload examples.
Using @AsyncListener
and @AsyncPublisher
any protocol can be documented, although the binding in the AsyncAPI document will remain empty.
The protocols with native support come along with a @_ProtocolName_Binding
annotation to define protocol specific properties.
Library:
Code Block | ||||
---|---|---|---|---|
| ||||
<dependency>
<groupId>io.github.springwolf</groupId>
<artifactId>springwolf-core</artifactId>
<version>0.16.0</version>
</dependency>
<dependency>
<groupId>io.github.springwolf</groupId>
<artifactId>springwolf-kafka</artifactId>
<version>0.16.0</version>
</dependency>
<dependency>
<groupId>io.github.springwolf</groupId>
<artifactId>springwolf-ui</artifactId>
<version>0.16.0</version>
</dependency> |
Properties file:
Code Block | ||||
---|---|---|---|---|
| ||||
# Springwolf Configuration
springwolf:
docket:
base-package: org.onap.policy.clamp.acm.runtime
info:
title: ACM Runtime
version: 1.0.0
description: ACM Runtime Documentation using Springwolf
# Springwolf Kafka Configuration
servers:
kafka:
protocol: kafka
url: ${topicServer:kafka:9092}
plugin:
kafka:
scanner:
kafka-listener:
enabled: false |
Example Java code:
Code Block | ||||
---|---|---|---|---|
| ||||
@AsyncListener(
operation = @AsyncOperation(
channelName = "policy-acruntime-participant",
description = "Listener ParticipantRegister",
payloadType = ParticipantRegister.class
)
)
@KafkaAsyncOperationBinding
public void handleParticipantMessage(ParticipantRegister participantRegisterMsg) {
-----
} |
http://localhost:6969/onap/policy/clamp/acm/springwolf/asyncapi-ui.html
Springwolf Kafka Plugin
Automated documentation for Spring Boot application with Kafka consumers.
This plugin generates an AsyncAPI document from @KafkaListener
methods. (ACM-Runtime do not using @KafkaListener).