Move file after successful ftp transfer using Java DSL

后端 未结 2 1320
忘掉有多难
忘掉有多难 2020-12-18 13:38

I\'ve defined a flow using spring-integration java dsl to ftp transfer a file, handle it, then transfer it back in an \"archive\" dir, and at last move it in a local archive

2条回答
  •  自闭症患者
    2020-12-18 14:35

    With the XML configuration we have a convention for one-way component like adapter, e.g. or . For the Java DSL we use the convention like Gateway suffix for the factory methods which produces request/reply endpoint. Otherwise it is one way, like yours a.ftp(ftpSessionFactory()).

    From other side with the XML configuration we don't have any choice to go ahead with downstream flow definition because there is no output-channel on the .

    With the Java DSL we don't have so much choice to prevent such a error like your. But I did there so comprehensive exception message which should follow you to the different way for your flow definition.

    And the answer for you is .publishSubscribeChannel(), when you can subscribe several endpoints to it to accept the same message to make different logic for it.

    Please, find my article where I explain most of SI Java DSL features line by line.

提交回复
热议问题