1 package de.example.spring.kafka;
3 import org.springframework.cloud.stream.messaging.Source;
4 import org.springframework.context.annotation.Bean;
5 import org.springframework.context.annotation.Configuration;
6 import org.springframework.messaging.converter.MessageConverter;
8 import com.fasterxml.jackson.databind.ObjectMapper;
11 public class SenderConfig {
14 public Sender sender(Source source) {
15 return new Sender(source);
19 public MessageConverter customMessageConverter(ObjectMapper objectMapper) {
20 MyCustomMessageConverter converter = new MyCustomMessageConverter();
21 converter.setSerializedPayloadClass(String.class);
22 if (objectMapper != null) {
23 converter.setObjectMapper(objectMapper);
30 // public MessageConverter avroMessageConverter() throws IOException {
31 // AvroSchemaMessageConverter converter = new AvroSchemaMessageConverter(MimeType.valueOf("avro/bytes"));
32 // //converter.setSchemaLocation(new ClassPathResource("schemas/User.avro"));