Error Channels

从版本 1.3 开始,绑定程序会无条件地将异常发送到每个使用者目标的错误通道,并且还可以配置为将异步生产者发送失败发送到错误通道。有关更多信息,请参阅 this section on error handling

Starting with version 1.3, the binder unconditionally sends exceptions to an error channel for each consumer destination and can also be configured to send async producer send failures to an error channel. See this section on error handling for more information.

发送失败的 ErrorMessage 的有效负载是一个 KafkaSendFailureException,具有以下属性:

The payload of the ErrorMessage for a send failure is a KafkaSendFailureException with properties:

  • failedMessage: The Spring Messaging Message<?> that failed to be sent.

  • record: The raw ProducerRecord that was created from the failedMessage

自动处理生产者异常(例如发送到 dead letter topic)不适用。你可以使用你自己的 Spring Integration 流程来使用这些异常。

There is no automatic handling of producer exceptions (such as sending to a dead letter topic). You can consume these exceptions with your own Spring Integration flow.