Merge pull request #2083 from pkedy/kafka_pubsub_metadata_as_headers_1408

Docs tweak for #1408 / #1409: Kafka PubSub using metadata as headers
This commit is contained in:
greenie-msft 2022-01-21 13:07:46 -08:00 committed by GitHub
commit 0f938b5c96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -310,6 +310,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. 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&metadata.partitionKey=key1 \
-H "Content-Type: application/json" \
-d '{
"data": {
"message": "Hi"
}
}'
```
## Create a Kafka instance
{{< tabs "Self-Hosted" "Kubernetes">}}