In spring integration, how do I catching different exceptions?

后端 未结 2 1272
自闭症患者
自闭症患者 2021-01-26 10:49

In spring integration I have a simple tcp client pipe: a gateway, a tcp outbound gateway a service activator plus an error channel. In the tcp-connection-factory there is a simp

2条回答
  •  长情又很酷
    2021-01-26 11:26

    You can define an error channel, that you provide to your inbound adapter. Here is an example:

        
        
    

    Now all exception that are thrown downstream will be catched by this error-channel. You can then define a service activator with this error channel as an input:

     
    

    And this activator refers to a bean that defines error handling logic.

提交回复
热议问题