...
Code Block | ||||
---|---|---|---|---|
| ||||
{ "schema": "urn:cps:org.onap.cps:data-updated-event-schema:v1", "id": "77b8f114-4562-4069-8234-6d059ff742ac", ... |
Consumer Ignores Type From Message Header
Event message header contains the type used by the producer when sending the message:
Header Key: __TypeId__
Header Value: org.onap.cps.event.model.CpsDataUpdatedEvent
In order to ensure that the listener would always be able to consume events produced with other future types, the consume should not use this type id from the header to force the type to be used for reading.
Then following property is added to application properties:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
spring:
kafka:
consumer:
properties:
spring.json.use.type.headers: false |
The type to be used by the consumer is already provided in the existing 'spring.json.value.default.type' property.
Conclusion
The minimal changes proposed above still give the option to make a forward compatible change in next coming release after Istanbul without introducing all the complexity coming with a complete solution right now, with the current design.
...