Skip to content

Instantly share code, notes, and snippets.

@MrMikeFloyd
Created December 15, 2021 12:27
Show Gist options
  • Save MrMikeFloyd/38fa19320cbf9b89dedb47007a3649d0 to your computer and use it in GitHub Desktop.
Save MrMikeFloyd/38fa19320cbf9b89dedb47007a3649d0 to your computer and use it in GitHub Desktop.
Application config for our sample data producer. Find the most recent version here: https://github.com/codecentric/spring-kafka-streams-example/blob/main/kafka-samples-producer/src/main/resources/application.yml
spring:
application:
name: kafka-telemetry-data-producer
cloud:
stream:
kafka:
binder:
brokers: "localhost:29092"
bindings:
telemetry-data-out-0:
producer:
configuration:
key.serializer: org.springframework.kafka.support.serializer.ToStringSerializer
value.serializer: org.springframework.kafka.support.serializer.JsonSerializer
# Otherwise de.codecentric.samples.kafkasamplesproducer.event.TelemetryData will be added as a header info
# which can't be deserialized by consumers (unless they have kafka.properties.spring.json.use.type.headers: false themselves)
spring.json.add.type.headers: false
bindings:
telemetry-data-out-0:
producer:
# use kafka internal encoding
useNativeEncoding: true
destination: space-probe-telemetry-data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment