From 6a73a1f4bdf14e7923cb255c8a1e23ec4052f20e Mon Sep 17 00:00:00 2001 From: Raja Kolli Date: Thu, 14 Sep 2023 16:09:16 +0000 Subject: [PATCH] #509, fixes issue with serialization --- .../src/main/resources/application.properties | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/catalog-service/src/main/resources/application.properties b/catalog-service/src/main/resources/application.properties index bb05d391..08285e1c 100644 --- a/catalog-service/src/main/resources/application.properties +++ b/catalog-service/src/main/resources/application.properties @@ -5,7 +5,19 @@ spring.webflux.base-path=/${spring.application.name} #Producer # spring.cloud.stream.kafka.binder.brokers=localhost:9092 +spring.cloud.stream.kafka.binder.enableObservation=true + spring.cloud.stream.bindings.inventory-out-0.destination=productTopic spring.cloud.stream.bindings.inventory-out-0.contentType=application/json +#To use custom serializer we should use native encoding as true +spring.cloud.stream.bindings.inventory-out-0.producer.use-native-encoding=true + +#use either below for all topics or below two if you want saperate serializers +spring.cloud.stream.kafka.default.producer.configuration.key.serializer=org.apache.kafka.common.serialization.StringSerializer +spring.cloud.stream.kafka.default.producer.configuration.value.serializer=org.springframework.kafka.support.serializer.JsonSerializer + +#spring.cloud.stream.kafka.bindings.inventory-out-0.producer.configuration.key.serializer=org.apache.kafka.common.serialization.StringSerializer +#spring.cloud.stream.kafka.bindings.inventory-out-0.producer.configuration.value.serializer=org.springframework.kafka.support.serializer.JsonSerializer + application.inventory-service-url=http://localhost:18181/inventory-service