Results 1 to 2 of 2

Thread: How to stop a poller in inbound channel adapter?

  1. #1
    Join Date
    Mar 2013
    Posts
    1

    Default How to stop a poller in inbound channel adapter?

    We are using an inbound-channel-adapter with poller configuration to work as a trigger to ftp-outbound-gateway to list and download the files from remote directory. But we want to provide timeout to our application that will stop that trigger( but not the whole application context) after that time so that the ftp-outbound-gateway would stop working but if some files are being downloaded then that should not be affected. Can Delayer be used in that case or how the poller in the inbound-channel-adapter could be stopped?

  2. #2
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    635

    Default

    Hi!

    or how the poller in the inbound-channel-adapter could be stopped
    It's easy:
    HTML Code:
    <inbound-channel-adapter id="myInboundAdapter" expression="''" channel="inputChannel">
    	<poller trigger="someTrigger"/>
    </inbound-channel-adapter>
    So, then you can invoke start/stop on whole endpoint (<inbound-channel-adapter>) via its "id" as a bean from application context:
    Code:
    ...
    @Autowired
    Lifecycle myInboundAdapter
    ...
    this.myInboundAdapter.stop()
    HTH,
    Artem

Tags for this Thread

Posting Permissions

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