Skip to content

Instantly share code, notes, and snippets.

@zlaval
Created December 1, 2021 13:33
Show Gist options
  • Save zlaval/13d1bd07363e4eb71bcccb3a5a9bf7a0 to your computer and use it in GitHub Desktop.
Save zlaval/13d1bd07363e4eb71bcccb3a5a9bf7a0 to your computer and use it in GitHub Desktop.
Yml example
string-producer-config: &string-consumer-config
consumer:
configuration:
key.deserializer: org.apache.kafka.common.serialization.StringDeserializer
value.deserializer: org.apache.kafka.common.serialization.StringDeserializer
avro-consumer-config: &avro-consumer-config
consumer:
configuration:
key.deserializer: org.apache.kafka.common.serialization.StringDeserializer
value.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer
schema.registry.url: http://localhost:8081
value.subject.name.strategy: io.confluent.kafka.serializers.subject.RecordNameStrategy
specific.avro.reader: true
autoCommitOffset: false
management:
server:
port: 9002
endpoints:
web:
exposure:
include: '*'
server:
port: 8080
spring:
application:
name: student-processor
kafka:
bootstrap-servers: localhost:9092
cloud:
stream:
function:
definition: processStudent;produceCityAndStreet
default-binder: kafka
kafka:
default:
producer:
recordMetadataChannel: producerMetadata
binder:
auto-create-topics: true
bindings:
processStudent-in-0:
<<: *avro-consumer-config
processStudent-in-1:
consumer:
configuration:
key.deserializer: org.apache.kafka.common.serialization.StringDeserializer
value.deserializer: org.springframework.kafka.support.serializer.JsonDeserializer
spring.json.trusted.packages: "*"
processStudent-out-0:
producer:
configuration:
key.serializer: org.apache.kafka.common.serialization.StringSerializer
value.serializer: org.springframework.kafka.support.serializer.JsonSerializer
produceCityAndStreet-in-0:
<<: *avro-consumer-config
produceCityAndStreet-out-0:
<<: *string-consumer-config
produceCityAndStreet-out-1:
<<: *string-consumer-config
bindings:
produceCityAndStreet-in-0:
destination: student-topic
contentType: application/*+avro
group: address-publisher-group
produceCityAndStreet-out-0:
destination: city-topic
produceCityAndStreet-out-1:
destination: steet-topic
processStudent-in-0:
destination: student-topic
contentType: application/*+avro
group: student-processor-group
processStudent-in-1:
destination: grade-topic
contentType: application/json
group: student-processor-group
processStudent-out-0:
destination: person-topic
contentType: application/json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment