1 package de.example.spring.kafka;
3 import org.springframework.cloud.stream.schema.avro.AvroSchemaMessageConverter;
4 import org.springframework.context.annotation.Bean;
5 import org.springframework.context.annotation.Configuration;
6 import org.springframework.core.io.ClassPathResource;
7 import org.springframework.messaging.converter.MessageConverter;
8 import org.springframework.util.MimeType;
10 import java.io.IOException;
13 public class ReceiverConfig {
16 public Receiver receiver() {
17 return new Receiver();
22 public MessageConverter customMessageConverter() {
23 return new MyCustomMessageConverter();
27 public MessageConverter avroMessageConverter() throws IOException {
28 AvroSchemaMessageConverter converter = new AvroSchemaMessageConverter(MimeType.valueOf("avro/bytes"));
29 //converter.setSchemaLocation(new ClassPathResource("schemas/User.avro"));