Spring Integration Executor Channel using annotations code sample

前端 未结 1 445
耶瑟儿~
耶瑟儿~ 2021-01-26 05:48

My system diagram is attached.

System Diagram

HOW THE FLOW WORKS:

The spring integration flow reads input from a json file on C:\\ and p

1条回答
  •  再見小時候
    2021-01-26 06:52

    You don't really need an ExecutorChannel - simply set ignoreFailures to true on the pub/sub channel...

    /**
     * Specify whether failures for one or more of the handlers should be
     * ignored. By default this is false meaning that an Exception
     * will be thrown whenever a handler fails. To override this and suppress
     * Exceptions, set the value to true.
     * @param ignoreFailures true if failures should be ignored.
     */
    public void setIgnoreFailures(boolean ignoreFailures) {
    

    If you want to log or otherwise handle exceptions on the DB store, you can add an ExpressionEvaluatingRequesthandlerAdvice to the component that does the DB store.

    If you really want an ExecutorChannel, the DSL section of the reference manual has an example.

    .channel(MessageChannels.executor("executorChannel", this.taskExecutor))
    

    0 讨论(0)
提交回复
热议问题