Adds support for Kafka message keys in contracts (#1585)

* Adds support for Kafka message keys in contracts

* Updated doc to include note on Kafka key SerDes

* Removes unintentional changes from previous commit.

Fixes gh-1267
This commit is contained in:
bono007
2021-02-04 06:44:10 -06:00
committed by GitHub
parent fcde7ee58d
commit 9a5c5a03f1
8 changed files with 133 additions and 154 deletions

View File

@@ -1201,18 +1201,21 @@ spring:
kafka:
bootstrap-servers: ${spring.embedded.kafka.brokers}
producer:
value-serializer: org.springframework.kafka.support.serializer.JsonSerializer
properties:
"value.serializer": "org.springframework.kafka.support.serializer.JsonSerializer"
"spring.json.trusted.packages": "*"
consumer:
value-deserializer: org.springframework.kafka.support.serializer.JsonDeserializer
properties:
"value.deserializer": "org.springframework.kafka.support.serializer.JsonDeserializer"
"value.serializer": "org.springframework.kafka.support.serializer.JsonSerializer"
"spring.json.trusted.packages": "*"
group-id: groupId
----
====
NOTE: If your application uses non-integer record keys you will need to set the `spring.kafka.producer.key-serializer`
and `spring.kafka.consumer.key-deserializer` properties accordingly because the Kafka de/serialization expects non-null
record keys to be of integer type.
Now consider the following contracts (we number them 1 and 2):
====