Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion docs/configuration/documenting-producers.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

On the same method, the protocol binding is defined. More details can be found in the [bindings](documenting-bindings.md) section.

Below is an example to demonstrate the annotation:
### Single parameter
Below is an example to demonstrate the annotation with a single parameter method:

```java
@AsyncPublisher(operation = @AsyncOperation(
Expand All @@ -31,6 +32,23 @@
// process
}
```
### Multiple parameters
The `@Payload` annotation is necessary for methods with multiple parameters, indicating which parameter is the payload. If this annotation is missing when multiple parameters are present, the Publisher will not be documented.

Check failure on line 36 in docs/configuration/documenting-producers.md

View workflow job for this annotation

GitHub Actions / Build

[vale] reported by reviewdog 🐶 [Microsoft.Contractions] Use 'won't' instead of 'will not'. Raw Output: {"message": "[Microsoft.Contractions] Use 'won't' instead of 'will not'.", "location": {"path": "docs/configuration/documenting-producers.md", "range": {"start": {"line": 36, "column": 203}}}, "severity": "ERROR"}

The annotation is available by importing the `spring-messaging` library.

Here's an example:
```java
@AsyncPublisher(operation = @AsyncOperation(
channelName = "example-producer-topic",
description = "Customer uploaded an example payload", // Optional
servers = {"kafka-server"} // Optional
))
@KafkaAsyncOperationBinding
public void sendMessage(@Payload ExamplePayloadDto msg, String otherParam) {
// process
}
```

:::note
Springwolf only finds methods that are within the `base-package`.
Expand Down
Loading