Skip to content

Commit 350accf

Browse files
authored
docs: add documentation for sqs (#53)
* docs: add documentatino for sqs * docs: Add 'Auto-generated' to vocab * Update accept.txt
1 parent 65b926c commit 350accf

File tree

7 files changed

+41
-27
lines changed

7 files changed

+41
-27
lines changed

.github/styles/Vocab/Springwolf/accept.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
AMQP
33
APIs
44
auto-detect
5+
Auto-detected
56
auto-detected
67
auto-detection
78
auto-generated
@@ -14,4 +15,4 @@ Netlify
1415
objectmapper
1516
Springfox
1617
Springwolf
17-
UI
18+
UI

docs/behind-the-scenes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ From there, Springwolf forwards the message to the protocol specific producer.
1818

1919
## Plugins
2020
`springwolf-core` provides the base functionality to orchestrate the scanning and building of the AsyncAPI document.
21-
The different protocol (AMQP, Kafka) are supported through plugins.
21+
The different protocol (AMQP, Kafka, SQS) are supported through plugins.
2222
These plugins are found through the Spring dependency injection functionality.
2323
When building own scanner plugins, your plugin will need to implement the `ChannelsScanner` interface.
2424

@@ -44,4 +44,4 @@ They follow the same plugin model.
4444

4545
## Putting it all together
4646
The `AsyncApiService` collects all the channels, schemas and general info and builds the AsyncApi document.
47-
The controller access this services to serve the document to the UI.
47+
The controller access this services to serve the document to the UI.

docs/configuration/configuration.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ There are 2 ways to configure Springwolf which can't be combined:
3131

3232
It's recommended to structure the project such that all consumers and producers (classes containing listener/producer methods) are in the same package - it's not mandatory, and if they're scattered across multiple packages, just provide the highest in hierarchy package that contains all classes.
3333

34-
The base package will be scanned for classes containing `@Component` annotated classes (that includes `@Service` annotated classes) for methods annotated with `@KafkaListener`, `@RabbitListener`, `@AsyncListener`, `@AsyncPublisher`, etc.
34+
The base package will be scanned for classes containing `@Component` annotated classes (that includes `@Service` annotated classes) for methods annotated with `@KafkaListener`, `@RabbitListener`, `@SqsListener`, `@AsyncListener`, `@AsyncPublisher`, etc.
3535

3636
### `id`
3737

@@ -75,6 +75,11 @@ The following table contains additional properties that can be specified in the
7575
| `springwolf.plugin.kafka.publishing.enabled` | `false` | Allow (anyone) to produce Kafka messages from the UI. *Note that this has security implications* |
7676
| `springwolf.plugin.kafka.publishing.producer` | `null` | Configure the Kafka producer used to publish messages from the UI. Uses identical parameters as `spring.kafka.producer` |
7777
| `springwolf.plugin.kafka.scanner.kafka-listener.enabled` | `true` | Enable scanner to find methods annotated with `@KafkaListener`. |
78+
| **SQS** | | |
79+
| `springwolf.plugin.sqs.publishing.enabled` | `false` | Allow (anyone) to produce SQS messages from the UI. *Note that this has security implications* |
80+
| `springwolf.plugin.sqs.scanner.sqs-listener.enabled` | `true` | Enable scanner to find methods annotated with `@SqsListener`. |
81+
82+
7883

7984
[identifier]: https://www.asyncapi.com/docs/reference/specification/v2.0.0#A2SIdString.
8085
[info]: https://www.asyncapi.com/docs/reference/specification/v2.0.0#infoObject.

docs/configuration/documenting-consumers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For these use-cases, Springwolf provides additional ways to explicitly add them
1212
To document consumers, either:
1313
- add the `@AsyncListener` annotation or
1414
- declare the `ConsumerData` object as part of the `AsyncApiDocket` or
15-
- rely on the auto-detection of `@KafkaListener`, `@RabbitListener`
15+
- rely on the auto-detection of `@KafkaListener`, `@RabbitListener`, `@SqsListener`
1616

1717
You are free to use all options together. Per channel and operation, first `ConsumerData` is used, then `@AsyncListener` and last the auto-detected annotations.
1818

@@ -172,8 +172,8 @@ The above Kafka `ConsumerData` simplifies to the following `KafkaConsumerData`:
172172
```
173173

174174

175-
## Option 3: `@KafkaListener`, `@RabbitListener`
176-
The `@KafkaListener` and `@RabbitListener` annotations are detected automatically.
175+
## Option 3: `@KafkaListener`, `@RabbitListener`, `@SqsListener`
176+
The `@KafkaListener`, `@RabbitListener`, `@SqsListener` annotations are detected automatically.
177177
There is nothing more to do.
178178
Use the other options if the provided documentation is insufficient.
179179

docs/introduction/introduction.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sidebar_position: 10
88
API Documentation is an important part of every project and product, but can be painful to maintain manually.
99
Spring Boot projects have great solutions for auto-generated documentation for REST APIs to overcome this pain (such as Springfox, or springdoc-openapi).
1010

11-
However, until now there were no solutions for asynchronous APIs (such as Kafka, AMQP etc.). Springwolf aims to solve this and provides auto-generated documentation for asynchronous APIs built in Spring Boot.
11+
However, until now there were no solutions for asynchronous APIs (such as AMQP, Kafka, SQS, etc.). Springwolf aims to solve this and provides auto-generated documentation for asynchronous APIs built in Spring Boot.
1212

1313
Springwolf is compliant to [AsyncAPI](https://www.asyncapi.com), which brings the [swagger/OpenAPI](https://www.asyncapi.com/docs/tutorials/getting-started/coming-from-openapi) specification you know already from REST APIs into the world of event-driven architectures.
1414

@@ -20,6 +20,7 @@ Also, the demos of the
2020
[AMQP](https://amqp.demo.springwolf.dev),
2121
[Spring Cloud Stream](https://cloud-stream.demo.springwolf.dev),
2222
[Kafka](https://kafka.demo.springwolf.dev)
23+
[SQS](https://sqs.demo.springwolf.dev)
2324
example projects are available.
2425

2526
![Springwolf publishing demo](/img/demo.gif)
@@ -44,5 +45,3 @@ By simply adding Springwolf dependency to your project you will automatically ge
4445
- An endpoint returning an AsyncAPI document describing your asynchronous API.
4546
- A web UI for convenient use by your developers, QA or clients of your asynchronous API.
4647
- An easy way to publish messages to your asynchronous API with a click of a button
47-
48-

docs/introduction/supported-protocols.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,32 @@ sidebar_position: 15
44

55
# Supported Protocols
66

7-
| Protocol | Annotation | Example Project | Latest Plugin Version |
8-
| --------------- | --------------------------------- | ----------------------------------------- | --------------------- |
9-
| AMQP (RabbitMQ) | `@RabbitListener` | [`springwolf-amqp-example`][amqp] | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-amqp?color=green&label=springwolf-amqp&style=plastic) |
10-
| Cloud Functions | | [`springwolf-cloud-stream`][cloud-stream] | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-cloud-stream?color=green&label=springwolf-cloud-stream&style=plastic) |
11-
| Kafka | `@KafkaListener`, `@KafkaHandler` | [`springwolf-kafka-example`][kafka] | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-kafka?color=green&label=springwolf-kafka&style=plastic) |
7+
Besides auto-detection of protocols (native support),
8+
any protocol can be defined using Springwolf custom annotations `@AsyncListener` and `@AsyncPublisher`.
9+
10+
## Native Support
11+
12+
The following protocols are supported natively:
13+
14+
| Protocol | Auto-detected annotations | Example Project | Latest Plugin Version |
15+
|-----------------|-----------------------------------|-------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
16+
| AMQP (RabbitMQ) | `@RabbitListener` | [`springwolf-amqp-example`][amqp] | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-amqp?color=green&label=springwolf-amqp&style=plastic) |
17+
| Cloud Functions | `@Bean` (functional interface) | [`springwolf-cloud-stream`][cloud-stream] | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-cloud-stream?color=green&label=springwolf-cloud-stream&style=plastic) |
18+
| Kafka | `@KafkaListener`, `@KafkaHandler` | [`springwolf-kafka-example`][kafka] | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-kafka?color=green&label=springwolf-kafka&style=plastic) |
19+
| SQS | `@SqsListener` | [`springwolf-sqs-example`][sqs] | ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-sqs?color=green&label=springwolf-sqs&style=plastic) |
20+
21+
Check out the example projects, which include a full `docker-compose` setup.
22+
The examples are simple, easy to start with, good for testing and reproducing bugs.
1223

1324
Please [open an issue](https://github.com/springwolf/springwolf-core/issues/new) if you want a protocol to be supported.
1425

26+
## Any protocol
27+
28+
Using [`@AsyncListener`](../configuration/documenting-consumers.md) and [`@AsyncPublisher`](../configuration/documenting-producers.md) any protocol can be documented, although the binding in the AsyncApi document will remain empty.
29+
30+
The protocols with native support come along with a `@_ProtocolName_Binding` annotation to define protocol specific properties.
1531

1632
[amqp]:https://github.com/springwolf/springwolf-core/tree/master/springwolf-examples/springwolf-amqp-example
17-
[kafka]: https://github.com/springwolf/springwolf-core/tree/master/springwolf-examples/springwolf-kafka-example
1833
[cloud-stream]:https://github.com/springwolf/springwolf-core/tree/master/springwolf-examples/springwolf-cloud-stream-example
34+
[kafka]: https://github.com/springwolf/springwolf-core/tree/master/springwolf-examples/springwolf-kafka-example
35+
[sqs]: https://github.com/springwolf/springwolf-core/tree/master/springwolf-examples/springwolf-sqs-example

docs/quickstart.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import CodeSpringwolfMaven from '!!raw-loader!./snippets/_springwolf_maven.xml';
99

1010
# Quickstart
1111

12-
*The following instructions are for Kafka services - but AMQP services configuration is almost same. Check out the [example project for complete examples](https://github.com/timonback/springwolf-core/tree/master/springwolf-examples).*
12+
*The following instructions are for Kafka services - but AMQP services configuration is almost same. Check out the [example project for complete examples](https://github.com/springwolf/springwolf-core/tree/master/springwolf-examples).*
1313

1414
## 1. Add dependencies
1515

@@ -24,12 +24,7 @@ Add the following dependencies:
2424
</TabItem>
2525
</Tabs>
2626

27-
Latest version:
28-
- ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-amqp?color=green&label=springwolf-amqp&style=plastic)
29-
- ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-cloud-stream?color=green&label=springwolf-cloud-stream&style=plastic)
30-
- ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-kafka?color=green&label=springwolf-kafka&style=plastic)
31-
- ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-ui?color=green&label=springwolf-ui&style=plastic)
32-
27+
Latest version: ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-core?color=green&label=springwolf&style=plastic)
3328
## 2. Configure properties
3429

3530
Add the following to your application.properties:
@@ -57,8 +52,5 @@ If you configured a different context path in your application, make sure to pre
5752
## 4. Next steps
5853

5954
- Read an elaborated tutorial on Baeldung at https://www.baeldung.com/java-spring-doc-asyncapi-springwolf
60-
- Check out the example projects:
61-
- AMQP: https://github.com/springwolf/springwolf-core/tree/master/springwolf-examples/springwolf-amqp-example
62-
- Spring-cloud-stream: https://github.com/springwolf/springwolf-core/tree/master/springwolf-examples/springwolf-cloud-stream-example
63-
- Kafka: https://github.com/springwolf/springwolf-core/tree/master/springwolf-examples/springwolf-kafka-example
55+
- Check out the [supported protocols and example projects](introduction/supported-protocols)
6456
- Dive deeper on the next pages

0 commit comments

Comments
 (0)