Announcement Announcement Module
Collapse
No announcement yet.
enriching file:inbound-channel-adapter message header with poller execution data Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • enriching file:inbound-channel-adapter message header with poller execution data

    I have a simple file inbound channel adapter and file outbound channel adapter configuration to basically move files from one folder to another

    the source folder read by the inbound channel adapter can have 10's of thounds of files in it.

    however, we do not want the target folder to receive all the files in a single folder.

    instead, we would like to limit this to say 1000 files per folder, and be able to control this using the max-messages-per-poll on the poller.

    the subdirectory can be a completely random name.

    is there anyway to possibly use a header enricher to extract some unqiue (if this exists) reference from the current poller execution "instance"

    Code:
    <channel id="filesToMoveChannel" />
    	
    <int-file:inbound-channel-adapter
    	channel="filesToMoveChannel"
    	directory="file:${move.source.directory}"
            filename-regex="${move.file.pattern}" >
            <poller max-messages-per-poll="1000" time-unit="SECONDS" fixed-rate="2" />
    </int-file:inbound-channel-adapter>   
    	
    <int-file:outbound-channel-adapter channel="filesToMoveChannel" delete-source-files="true" directory="file:${move.target.directory}" >
    </int-file:outbound-channel-adapter>
    thanks in advance
    Shaine

  • #2
    thinking about this, I can probably just use a file-name-generator on the out-bound-adapter that has a "subfolder" setting in it, that then does a count on the current subfolder

    Comment

    Working...
    X