我无法从我的应用程序向kafka发送短信,但当我尝试发送一个Object(事件)时,我收到一个例外:
INFO:ErrorMessage [payload = org.springframework.messaging.MessageHandlingException:消息处理程序中发生错误[org.springframework.integration.kafka.outbound.KafkaProducerMessageHandler#0];嵌套异常是java.lang.NullPointerException:在org.springframework.data.mongodb.core.mapping.event.AfterSaveEvent null org.springframework.data.mongodb.core.mapping.event.AfterSaveEvent,headers = {id = 9068de1b- a1cc-c1b5-463a-107b7be21af4,时间戳= 1456754038408}] 1000
<int-kafka:producer-context id="kafkaProducerContext" producer-properties="producerProperties">
<int-kafka:producer-configurations>
<!-- Kafaka events topic -->
<int-kafka:producer-configuration
broker-list="localhost:9092"
key-class-type="java.lang.String"
key-encoder="kafkaReflectionEncoder"
value-encoder="kafkaReflectionEncoder"
value-class-type="org.springframework.data.mongodb.core.mapping.event.AfterSaveEvent"
topic="eventsstream"
compression-type="none"
/>
</int-kafka:producer-configurations>
</int-kafka:producer-context>
<bean id="kafkaReflectionEncoder" class="org.springframework.integration.kafka.serializer.avro.AvroReflectDatumBackedKafkaEncoder">
<constructor-arg value="java.lang.String" />
</bean>
欢迎任何帮助......