it is just because of the maxMessagesPerPoll(50). Since this has been given to the new GenericMessage<>, it produces 50 "/a-remote-directory/" messages per poll, so the max message per poll should be 1 for recursive LS for sFTP file listing.