Skip to content

Instantly share code, notes, and snippets.

@j-tim
Created January 17, 2020 13:22
Show Gist options
  • Save j-tim/954fa3326affa5994c17f21994bb23db to your computer and use it in GitHub Desktop.
Save j-tim/954fa3326affa5994c17f21994bb23db to your computer and use it in GitHub Desktop.
Spring Boot / Spring Kafka Avro configuration
server:
port: 8082
spring:
application:
name: "stock-tick-consumer-avro"
kafka:
bootstrap-servers: localhost:9092
properties:
schema.registry.url: http://localhost:8081
# Tells Kafka / Schema Registry that we will be using a specific Avro type
# (StockTick type in this case) otherwise Kafka will expect GenericRecord to be used on the topic.
specific.avro.reader: true
consumer:
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
value-deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer
client-id: ${spring.application.name}
group-id: ${spring.application.name}-group
# At application startup a missing topic on the broker will not fail the
# application startup
listener:
missing-topics-fatal: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment