Results 1 to 5 of 5

Thread: to determine success or a failure in a sftp channel

  1. #1
    Join Date
    Feb 2012
    Posts
    101

    Default to determine success or a failure in a sftp channel

    Hi,

    I would like to know how a success or failure can be achieved in the sftp outbound adapter.

    Thanks

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,146

    Default

    A number of options, including...

    A.

    1. Make the channel the adapter subscribe to a <publish-subscribe-channel />
    2. Add an order attribute to the adapter (="1")
    3. Add another endpoint (e.g. <service-activator/>) as a subscriber to the same channel, with order="2".

    The second endpoint will only be called if the sftp operation is successful.

    B.

    1. Add an error-channel to the flow's inbound endpoint.
    2. If the sftp operation fails, an ErrorMessage will be sent to the error-channel. If no ErrorMessag, the operation was successful.

    C.

    Both A. and B.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Feb 2012
    Posts
    101

    Default

    Thanks Gary.I will try the second option.

  4. #4
    Join Date
    Feb 2012
    Posts
    101

    Default

    Are there any samples to configure the error channel?
    I would appreciate any help.

    Thanks

  5. #5
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,146

    Default

    Oleg's SpringOne demo is one...

    https://github.com/olegz/s12gx.2011/...egration/error

    Here's another... https://github.com/SpringSource/spri...mo-context.xml

    Basically, you put an error-channel on the inbound endpoint and it gets an ErrorMessage who's payload is a MessagingException; this has two important properties cause (the exception) and failedMessage (the message that failed).
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •