1 package de.example.spring.kafka;
3 import org.springframework.context.annotation.Bean;
4 import org.springframework.context.annotation.Configuration;
5 import org.springframework.messaging.converter.MessageConverter;
7 import com.fasterxml.jackson.databind.ObjectMapper;
10 public class ReceiverConfig {
13 public Receiver receiver() {
14 return new Receiver();
19 public MessageConverter customMessageConverter(ObjectMapper objectMapper) {
20 MyCustomMessageConverter converter = new MyCustomMessageConverter();
21 converter.setSerializedPayloadClass(String.class);
22 if (objectMapper != null) {
23 converter.setObjectMapper(objectMapper);
31 // public MessageConverter avroMessageConverter() throws IOException {
32 // AvroSchemaMessageConverter converter = new AvroSchemaMessageConverter(MimeType.valueOf("avro/bytes"));
33 // //converter.setSchemaLocation(new ClassPathResource("schemas/User.avro"));