You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/behind-the-scenes.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ sidebar_position: 70
7
7
The following paragraphs describe how Springwolf works internally.
8
8
9
9
## Big Picture
10
+
10
11
When the Spring Boot application is started, Springwolf uses its scanners to find defined consumers and producers within the application.
11
12
Based on the results, the channels/topics are extracted including payload type and merged together into an [AsyncAPI conform document](https://www.asyncapi.com/docs/reference/specification/v3.0.0).
12
13
@@ -17,19 +18,22 @@ When publishing is enabled, the user can publish a message through the UI to ano
17
18
From there, Springwolf forwards the message to the protocol specific producer.
18
19
19
20
## Plugins
21
+
20
22
`springwolf-core` provides the base functionality to orchestrate the scanning and building of the AsyncAPI document.
21
23
The different protocol (AMQP, Cloud-Stream, JMS, Kafka, SNS, SQS) are supported through plugins.
22
24
These plugins are found through the Spring dependency injection functionality.
23
25
When building own scanner plugins, your plugin will need to implement the `ChannelsScanner` interface.
24
26
25
27
## Scanners
28
+
26
29
`springwolf-core` runs all scanners and merges the found results together into one AsyncAPI document.
27
30
When the same channel/topic is found multiple times, it's merged as well.
28
31
29
32
The result is a [`ChannelItem`](https://www.asyncapi.com/docs/reference/specification/v3.0.0#channelObject).
30
33
The `ChannelObject` contains the `Message` for the receive and/or send operation.
31
34
32
35
## Building an example payload
36
+
33
37
When the scanners scan and build the result, they also extract the payload type.
34
38
The payload is registered in the `ComponentsService`, which allows to split the `Message` from the schema definition - within the AsyncAPI doc a `$ref` references is used.
35
39
@@ -40,9 +44,11 @@ Additionally, Springwolf generates an example based on the provided schema.
40
44
By using `swagger-parser`, all the `@Schema` and other swagger annotations are supported as well as `@JsonProperty` through the use of the ObjectMapper.
41
45
42
46
### ModelConverters
47
+
43
48
ModelConverters provide a way to improve documentation for classes, which can't be modified, for example because they're part of an external library.
44
49
They follow the same plugin model.
45
50
46
51
## Putting it all together
52
+
47
53
The `AsyncApiService` collects all the channels, schemas and general info and builds the AsyncApi document.
48
54
The controller access this services to serve the document to the UI.
Copy file name to clipboardExpand all lines: docs/configuration/configuration.mdx
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,15 +80,14 @@ The following table contains additional properties that can be specified in the
80
80
|`springwolf.plugin.sqs.publishing.enabled`|`false`| Allow (anyone) to produce SQS messages from the UI. *Note that this has security implications*|
81
81
|`springwolf.plugin.sqs.scanner.sqs-listener.enabled`|`true`| Enable scanner to find methods annotated with `@SqsListener`. |
82
82
83
-
84
-
85
83
## Actuator support
86
84
87
85
Springwolf supports exposing the AsyncAPI document as part of Spring Boot’s actuator endpoint.
88
86
The AsyncAPI document will then be moved underneath actuators base path, that's `/actuator/springwolf/docs.json` or `/actuator/springwolf/docs.yaml` respectively.
89
87
90
88
To enable it, add the `spring-boot-actuator` dependency first.
91
89
Second, enable the actuator endpoint in the `application.properties` file:
@@ -130,27 +137,34 @@ The Channel Bindings Object is used to describe the Google Cloud Pub/Sub Topic d
130
137
lastRevisionId="lastRevisionId",
131
138
name="projects/{project}/schemas/{schema}"))
132
139
```
133
-
`MessageRetentionDuration`: Indicates the minimum duration to retain a message after it's published to the topic
140
+
141
+
`MessageRetentionDuration`: Indicates the minimum duration to retain a message after it's published to the topic
134
142
135
143
`Message Storage Policy`: The Message Storage Policy Object is used to describe the Google Cloud Pub/Sub MessageStoragePolicy.
136
-
- A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage
144
+
145
+
- A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage
137
146
138
147
`Schema Settings`:The Schema Settings Object is used to describe the Google Cloud Pub/Sub SchemaSettings.
148
+
139
149
- encoding: The encoding of the message
140
150
- firstRevisionId: The minimum (inclusive) revision allowed for validating messages
141
151
- lastRevisionId: The maximum (inclusive) revision allowed for validating messages
142
152
- name: The name of the schema that messages published should be validated against (The format is `projects/{project}/schemas/{schema}`.)
153
+
143
154
#### Message Binding Object
155
+
144
156
The Message Binding Object is used to describe the Google Cloud Pub/Sub PubsubMessage details, alongside with pertinent parts of the Google Cloud Pub/Sub Schema Object.
`OrderingKey`: If non-empty, identifies related messages for which publish order should be respected
151
165
152
166
`Schema Definition`: The Schema Definition Object is used to describe the Google Cloud Pub/Sub Schema Object with AsyncAPI. While some of this information could be, or is, described using native AsyncAPI, for consistency it makes sense to provide this information here at all times, especially for cases where AsyncAPI doesn't natively support describing payloads using a supported Google Cloud Pub/Sub schema format like Protobuf
0 commit comments