我尝试了Spring EnableSchemaRegistryClient producer consumer sample
只要生产者和消费者都是Spring应用程序,它就可以工作。但是,如果我使用由Kafka生产者编写的其他生产者,则EnableSchemaRegistryClient消费者会引发错误。
Producer<String, Transaction> producer = new KafkaProducer<String, Transaction>(props);
ProducerRecord<String, Transaction> record = new ProducerRecord<String, Transaction>(topic, transaction.getAccount().toString(), transaction);
RecordMetadata rm = producer.send(record).get();
错误:
org.springframework.messaging.converter.MessageConversionException: Could not read JSON: Invalid UTF-32 character 0x50f4341 (above 0x0010ffff) at char #1, byte #7); nested exception is java.io.CharConversionException: Invalid UTF-32 character 0x50f4341 (above 0x0010ffff) at char #1, byte #7)
at org.springframework.messaging.converter.MappingJackson2MessageConverter.convertFromInternal(MappingJackson2MessageConverter.java:234) ~[spring-messaging-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at