Docs tweak for #1408 / #1409: Kafka PubSub using metadata as headers

Signed-off-by: Phil Kedy <phil.kedy@gmail.com>
This commit is contained in:
Phil Kedy 2022-01-05 10:18:08 -05:00
parent ae846747a9
commit 6079c0e34b
1 changed files with 14 additions and 0 deletions

View File

@ -136,6 +136,20 @@ curl -X POST http://localhost:3500/v1.0/publish/myKafka/myTopic?metadata.partiti
}'
```
### Message headers
All other metadata key/value pairs (that are not `partitionKey`) are set as headers in the Kafka message. For example, here is an example setting a `correlationId` for the message.
```shell
curl -X POST http://localhost:3500/v1.0/publish/myKafka/myTopic?metadata.correlationId=myCorrelationID \
-H "Content-Type: application/json" \
-d '{
"data": {
"message": "Hi"
}
}'
```
## Create a Kafka instance
{{< tabs "Self-Hosted" "Kubernetes">}}