Ich habe ein Problem, dass Quelle sendet eine GenericMessage [Nutzlast = xxxxx, ...], während Senke die Nachricht als 10,120,120,120,120,120 empfängt.Spring Cloud Stream mit Avro kann String-Nachricht nicht korrekt konvertieren
Dieses Problem trat auf, nachdem ich Avro-Nachrichtenkonverter eingerichtet hatte. Wenn ich Avro-Nachrichtenkonverter entferne und StreamListener für die Nachrichtenkonvertierung verwende, funktioniert das problemlos.
Quelle application.properties
spring.cloud.stream.bindings.toGreeting.destination=greeting
spring.cloud.stream.bindings.toGreeting.contentType=application/*+avro
spring.cloud.stream.schema.avro.dynamicSchemaGenerationEnabled=true
Sink Anwendung
server.port=8990
spring.cloud.stream.bindings.greeting.destination=greeting
Nachricht Converter
@Configuration
@EnableSchemaRegistryClient
public class MessageConverterConfig {
@Bean
public MessageConverter topic1MessageConverter() throws IOException {
return new AvroSchemaMessageConverter(MimeType.valueOf("avro/bytes"));
}
}
Anwendungsklasse
@SpringBootApplication
@EnableSchemaRegistryClient
public class SourceApplication {
public static void main(String[] args) {
SpringApplication.run(SourceApplication.class, args);
}
}
@EnableSchemaRegistryServer
@EnableSchemaRegistryClient
@SpringBootApplication
public class SinkApplication {
public static void main(String[] args) {
SpringApplication.run(SinkApplication.class, args);
}
}
Fehle ich Konfigurationen? Danke.