Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Investigation on using Async-api for clamp messaging doc.

Tool:

  • Java AsyncAPI: This tool stores modules, which simplifies interacting with AsyncAPI in jvm ecosystem.
  • SCS MultiApi Plugin: This is a plugin designed to help developers automatizing the creation of code classes from YML files based on AsyncApi and OpenAPI. It…

  • ZenWave SDK: DDD and API-First for Event-Driven Microservices
  • Springwolf: Automated documentation for event-driven applications built with Spring Boot

SCS MultiApi Plugin

This is a plugin designed to help developers automatizing the creation of code classes from YML files based on AsyncApi and OpenAPI. It is presented in 2 flavours Maven and Gradle (MPL-2.0 license).

This plugin allows developers to automatize the creation of code classes for REST and Kafka connections, based on YML files under the AsyncApi and OpenApi specifications. In the latter case, many of the configuration options and classes that are generated are based on reimplementation or modification of the OpenAPI Generator models and template designs.

The generation of the REST and Kafka connections is independent each other and could be used only one, or both at the same time.

Link: (https://github.com/sngular/scs-multiapi-plugin)

ZenWave SDK

ZenWave SDK is a configurable and extensible toolkit for Domain Driven Design (DDD) and API-First that can generate code from a mix of different models including (MIT license):

  • ZDL Domain Language
  • AsyncAPI
  • OpenAPI

Link: (https://github.com/zenwave360/zenwave-sdk)

Springwolf

 It documents asynchronous APIs using the AsyncAPI specification. (Apache License 2.0).

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:

pom
        <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:

application.yaml
# 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:

SupervisionParticipantHandler class
    @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).


  • No labels