Announcement Announcement Module
Collapse
No announcement yet.
FTP Inbound Channel Adapter threads Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • FTP Inbound Channel Adapter threads

    I'm using the following ftp inbound channel adapter from spring-integration-ftp 2.1.4.RELEASE:

    Code:
    <int-ftp:inbound-channel-adapter id="ftpInboundAdapter"
    		channel="ftpInChannel"
    		session-factory="ftpSessionFactory"
    		local-directory="file:/ftp_temp"
    		local-filename-generator-expression="#this + '_temp.txt'"
    		remote-directory="Inventory/Transform"
    		filename-pattern="*_RESPONSE.txt"
    		delete-remote-files="true"
    		>
    		<int:poller fixed-rate="60000" />
    	</int-ftp:inbound-channel-adapter>
    I've noticed that 10 task-scheduler threads are being created, I assume for the poller. The initial poll happens on the first thread, each subsequent poll creating another thread, until it hits 10 threads. At that point, it seems the polling all happens on the same thread. This seems sub-optimal. Is there a reason this is happening, or is something else creating the task-scheduler threads?

  • #2
    Not sure why you say it's suboptimal; anyway, yes, the default taskScheduler has 10 threads. If you wish to override it, simply create a <task:scheduler /> with the same Id and configure it as you wish.

    http://static.springsource.org/sprin...-taskscheduler

    Comment


    • #3
      Is the task scheduler just used for polling, or is the message processed (i.e. via a service activator on the destination channel) on the same thread? The thread pool makes sense to me if message processing happens on the thread. I assumed the thread pool was dedicated just to polling, and couldn't imagine why you'd want to concurrently poll a message source...

      Comment


      • #4
        You can configure it however you want. By default, the poller uses a SyncTaskExecutor, which means a message received from the source (in your case a FileReadingMessageSource) is processed on the scheduler's thread directly. However, you can add a task-executor to the poller, in which case the scheduler thread hands the work off to the task executor's thread to process the message.

        Comment

        Working...
        X