Search code examples
spring-cloud-dataflow

Spring Cloud Data Flow programmable application's error channel


How can I define or program an app's error channel that will receive all messages that have failed in processors/sinks?

The documentation says the following:

When the number of retry attempts has exceeded the maxAttempts value, the exception and the failed message will become the payload of a message and be sent to the application’s error channel. By default, the default message handler for this error channel logs the message. You can change the default behavior in your application by creating your own message handler that subscribes to the error channel.

After that documentation talks about enabling dead letter queues in binders. If I understand that correctly, the whole concept means that I can write my own handler that will subscribe to the DLQ of the binder and receive the messages.

I am curious, if it is possible to define a separate stream that will receive failed messages, or write an additional app that will receive those failed payloads and process them how it wants without utilizing the DLQ of the binder?


Solution

  • Assuming you've enabled DLQ and depending on the binder implementation in use, you may have to create a separate application to drain and process messages from DLQ.

    The recommended approaches for rabbit-binder, for example, can be found in the docs.