我无法从我的应用程序向 kafka 发送短信,但是当我尝试发送对象(事件)时,我收到一个异常:
信息:ErrorMessage [payload=org.springframework.messaging.MessageHandlingException:消息处理程序中发生错误 [org.springframework.integration.kafka.outbound.KafkaProducerMessageHandler#0];嵌套异常是 java.lang.NullPointerException: in org.springframework.data.mongodb.core.mapping.event.AfterSaveEvent null of 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>
欢迎任何帮助...