Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…hub.io

# Conflicts:
#	docs/configuration/configuration.mdx
#	docs/configuration/snippets/_configuration_properties.properties
#	docs/quickstart.mdx
  • Loading branch information
mmiikkkkaa committed Jun 19, 2024
2 parents d03234a + 4b5b833 commit 3c0d828
Show file tree
Hide file tree
Showing 21 changed files with 1,583 additions and 1,708 deletions.
1 change: 1 addition & 0 deletions docs/behind-the-scenes.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ When building own scanner plugins, your plugin will need to implement the `Chann

`springwolf-core` runs all scanners and merges the found results together into one AsyncAPI document.
When the same channel/topic is found multiple times, it's merged as well.
One example of such, is when a method uses the Springwolf `@AsyncListener` annotation together with the protocol annotation, like `@KafkaListener`.

The result is a [`ChannelItem`](https://www.asyncapi.com/docs/reference/specification/v3.0.0#channelObject).
The `ChannelObject` contains the `Message` for the receive and/or send operation.
Expand Down
5 changes: 3 additions & 2 deletions docs/configuration/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ All provided fields will be present in the generated document, but not all will
### `Servers` (required)

The `Server` object provides metadata to help the reader understand the protocol, version, login details and more (see [AsyncAPI Server Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#serversObject)).
Any name (`kafka-server` in the example) can be chosen.

An AsyncAPI document can contain more than one server, but it's not common.

Expand Down Expand Up @@ -60,7 +61,7 @@ The following table contains additional properties that can be specified in the
| `springwolf.init-mode` | `fail_fast` | Springwolf initializes during start up with `fail_fast` or in the `background` after the application has started. |
| `springwolf.paths.docs` | `/springwolf/docs` | The path of the AsyncAPI document in JSON format. *Note that at the moment the UI will work only with the default value.* |
| `springwolf.endpoint.actuator.enabled` | `false` | Publish the AsyncAPI document as part of Spring Boot’s actuator feature. |
| `springwolf.use-fqn` | `true` | Use fully qualified names for the schema classes. **Required for publishing** |
| `springwolf.use-fqn` | `true` | Use fully qualified names for the schema classes. **Required for publishing with `springwolf-ui`** |
| `springwolf.payload.extractable-classes..` | N/A | Extract additional payload types. See [message payloads](documenting-messages.mdx) for more details. |
| `springwolf.scanner.async-listener.enabled` | `true` | Enable scanner to find methods annotated with `@AsyncListener`. |
| `springwolf.scanner.async-publisher.enabled` | `true` | Enable scanner to find methods annotated with `@AsyncPublisher`. |
Expand All @@ -72,7 +73,7 @@ The following table contains additional properties that can be specified in the
| `springwolf.plugin.jms.scanner.jms-listener.enabled` | `true` | Enable scanner to find methods annotated with `@JmsListener`. |
| **Kafka** | | |
| `springwolf.plugin.kafka.publishing.enabled` | `false` | Allow (anyone) to produce Kafka messages from the UI. *Note that this has security implications* |
| `springwolf.plugin.kafka.publishing.producer` | `null` | Configure the Kafka producer used to publish messages from the UI. Uses identical parameters as `spring.kafka.producer`. [SpringwolfKafkaProducer](https://github.com/springwolf/springwolf-core/blob/master/springwolf-examples/springwolf-kafka-example/src/main/java/io/github/springwolf/examples/kafka/configuration/CustomSpringwolfKafkaProducer.java#L20) demonstrates multiple producer configuration to publish to Avro and Protobuf. |
| `springwolf.plugin.kafka.publishing.producer` | `null` | Configure the Kafka producer used to publish messages from the UI. Uses identical parameters as `spring.kafka.producer`. [SpringwolfKafkaProducer](https://github.com/springwolf/springwolf-core/blob/b7c7fa508daf3e9c887eb8924cef78af4ed4de1f/springwolf-examples/springwolf-kafka-example/src/main/java/io/github/springwolf/example/kafka/configuration/CustomSpringwolfKafkaProducer.java#L20) demonstrates multiple producer configuration to publish to Avro and Protobuf. |
| `springwolf.plugin.kafka.scanner.kafka-listener.enabled` | `true` | Enable scanner to find methods annotated with `@KafkaListener`. |
| **SNS** | | |
| `springwolf.plugin.sns.publishing.enabled` | `false` | Allow (anyone) to produce SNS messages from the UI. *Note that this has security implications* |
Expand Down
4 changes: 2 additions & 2 deletions docs/configuration/documenting-consumers.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Below is an example to demonstrate the annotation:
@AsyncListener(operation = @AsyncOperation(
channelName = "example-consumer-topic",
description = "Customer uploaded an example payload", // Optional
servers = {"kafka"}, // Optional
servers = {"kafka-server"}, // Optional
headers = @AsyncOperation.Headers( // Optional
schemaName = "SpringKafkaDefaultHeaders",
values = {
Expand Down Expand Up @@ -73,7 +73,7 @@ Optional. The headers describing the metadata of the payload.
### Servers

Optional. Useful when an application is connect to multiple brokers and wants to indicate to which broker the channel belongs to.
The server needs to exist in [configuration > Servers](configuration.mdx) as well.
The server name needs to exist in [configuration > Servers](configuration.mdx) as well.

## `@JmsListener`, `@KafkaListener`, `@RabbitListener`, `@SqsListener`

Expand Down
4 changes: 2 additions & 2 deletions docs/configuration/documenting-producers.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Below is an example to demonstrate the annotation:
@AsyncPublisher(operation = @AsyncOperation(
channelName = "example-producer-topic",
description = "Customer uploaded an example payload", // Optional
servers = {"kafka"}, // Optional
servers = {"kafka-server"}, // Optional
headers = @AsyncOperation.Headers( // Optional
schemaName = "SpringKafkaDefaultHeaders",
values = {
Expand Down Expand Up @@ -67,4 +67,4 @@ Optional. The headers describing the metadata of the payload.
### Servers

Optional. Useful when an application is connect to multiple brokers and wants to indicate to which broker the channel belongs to.
The server needs to exist in [configuration > Servers](configuration.mdx) as well.
The server name needs to exist in [configuration > Servers](configuration.mdx) as well.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ springwolf.docket.base-package=io.github.springwolf.example
springwolf.docket.info.title=${spring.application.name}
springwolf.docket.info.version=1.0.0

springwolf.docket.servers.kafka.protocol=kafka
springwolf.docket.servers.kafka.host=${spring.kafka.bootstrap-servers}
springwolf.docket.servers.kafka-server.protocol=kafka
springwolf.docket.servers.kafka-server.host=${spring.kafka.bootstrap-servers}

# Springwolf - optional fields
springwolf.enabled=true
Expand Down
13 changes: 8 additions & 5 deletions docs/introduction/supported-protocols.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ Springwolf also provides some libraries to document bindings. Those libraries pr

The supported binding annotations are:

| Protocol | Annotations | Latest Plugin Version |
|---------------|-------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| GooglePubSub | `@GooglePubSubAsyncChannelBinding` | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-googlepubsub-binding?color=green&label=springwolf-googlepubsub-binding&style=plastic) |
| SNS | `@SnsAsyncOperationBinding` | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-sns-binding?color=green&label=springwolf-sns-binding&style=plastic) |
| SQS | `@SqsAsyncOperationBinding` | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-sqs-binding?color=green&label=springwolf-sqs-binding&style=plastic) |
| Protocol | Annotations | Latest Plugin Version |
|--------------|------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| AMQP | `@AmqpAsyncOperationBinding` | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-amqp-binding?color=green&label=springwolf-amqp-binding&style=plastic) |
| GooglePubSub | `@GooglePubSubAsyncChannelBinding` | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-googlepubsub-binding?color=green&label=springwolf-googlepubsub-binding&style=plastic) |
| JMS | `@JmsAsyncOperationBinding` | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-jms-binding?color=green&label=springwolf-jms-binding&style=plastic) |
| Kafka | `@KafkaAsyncOperationBinding` | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-kafka-binding?color=green&label=springwolf-kafka-binding&style=plastic) |
| SNS | `@SnsAsyncOperationBinding` | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-sns-binding?color=green&label=springwolf-sns-binding&style=plastic) |
| SQS | `@SqsAsyncOperationBinding` | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-sqs-binding?color=green&label=springwolf-sqs-binding&style=plastic) |

:::info
See [Add-Ons / Generic Annotation Binding](../add-ons#generic-binding)
Expand Down
4 changes: 2 additions & 2 deletions docs/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ 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.protocol=kafka
springwolf.docket.servers.kafka.host=${kafka.bootstrap.servers:localhost:29092}
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.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dependencies {
implementation 'io.github.springwolf:springwolf-common-model-converters:1.2.0'
implementation 'io.github.springwolf:springwolf-common-model-converters:1.3.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<dependency>
<groupId>io.github.springwolf</groupId>
<artifactId>springwolf-common-model-converters</artifactId>
<version>1.2.0</version>
<version>1.3.0</version>
</dependency>
</dependencies>
2 changes: 1 addition & 1 deletion docs/snippets/_springwolf_generic_binding_groovy.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dependencies {
implementation 'io.github.springwolf:springwolf-generic-binding:1.2.0'
implementation 'io.github.springwolf:springwolf-generic-binding:1.3.0'
}
2 changes: 1 addition & 1 deletion docs/snippets/_springwolf_generic_binding_maven.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<dependency>
<groupId>io.github.springwolf</groupId>
<artifactId>springwolf-generic-binding</artifactId>
<version>1.2.0</version>
<version>1.3.0</version>
</dependency>
</dependencies>
4 changes: 2 additions & 2 deletions docs/snippets/_springwolf_groovy.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies {
// Provides the documentation API
implementation 'io.github.springwolf:springwolf-kafka:1.2.0'
implementation 'io.github.springwolf:springwolf-kafka:1.3.0'

// Provides the UI - optional (recommended)
runtimeOnly 'io.github.springwolf:springwolf-ui:1.2.0'
runtimeOnly 'io.github.springwolf:springwolf-ui:1.3.0'
}
2 changes: 1 addition & 1 deletion docs/snippets/_springwolf_json_schema_groovy.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dependencies {
implementation 'io.github.springwolf:springwolf-json-schema:1.2.0'
implementation 'io.github.springwolf:springwolf-json-schema:1.3.0'
}
2 changes: 1 addition & 1 deletion docs/snippets/_springwolf_json_schema_maven.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<dependency>
<groupId>io.github.springwolf</groupId>
<artifactId>springwolf-json-schema</artifactId>
<version>1.2.0</version>
<version>1.3.0</version>
</dependency>
</dependencies>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dependencies {
implementation 'io.github.springwolf:springwolf-kotlinx-serialization-model-converter:1.2.0'
implementation 'io.github.springwolf:springwolf-kotlinx-serialization-model-converter:1.3.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<dependency>
<groupId>io.github.springwolf</groupId>
<artifactId>springwolf-kotlinx-serialization-model-converter</artifactId>
<version>1.2.0</version>
<version>1.3.0</version>
</dependency>
</dependencies>
4 changes: 2 additions & 2 deletions docs/snippets/_springwolf_maven.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<dependency>
<groupId>io.github.springwolf</groupId>
<artifactId>springwolf-kafka</artifactId>
<version>1.2.0</version>
<version>1.3.0</version>
</dependency>
<!-- Provides the UI - optional (recommended) -->
<dependency>
<groupId>io.github.springwolf</groupId>
<artifactId>springwolf-ui</artifactId>
<version>1.2.0</version>
<version>1.3.0</version>
</dependency>
</dependencies>
2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const config = {
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl: 'https://github.com/springwolf/springwolf.github.io/edit/master/',
sidebarCollapsed: false,
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
Expand Down
Loading

0 comments on commit 3c0d828

Please sign in to comment.