Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SFTP Adapters]Allow clearing unprocessed files in AbstractRemoteFileStreamingMessageSource #8898

Closed
kkosiacki opened this issue Feb 11, 2024 · 0 comments

Comments

@kkosiacki
Copy link
Contributor

Expected Behavior

When I'm using RotatingServerAdvice when pooling files from different remote, I want to have ability to remove unprocessed files from queue, to avoid trying to get file from remote when Session is rotated.

Current Behavior

When you have DelegatingSessionFactory with RotatingServerAdvice and there are unprocessed files in queue (see toBeReceived in AbstractRemoteFileStreamingMessageSource), when you call doReceive MessageSource will try to retrieve file from queue and it will be success or not depends on Session return from DelegatingSessionFactory. If rotation happened and 'new' session is not able to retrieve file from remote, exception is thrown (access denied) that clears that internal queue.

Context
I want to add public method on AbstractRemoteFileStreamingMessageSource thats allow developer to decide if he wants to clean this queue (before doReceive). It means that you can write own RotatingPolicy that will clear toBeReceived queue if necessary.

@kkosiacki kkosiacki added status: waiting-for-triage The issue need to be evaluated and its future decided type: enhancement labels Feb 11, 2024
kkosiacki added a commit to kkosiacki/spring-integration that referenced this issue Feb 11, 2024
@artembilan artembilan added this to the 6.3.0-M1 milestone Feb 12, 2024
@artembilan artembilan added in: sftp in: ftp in: smb and removed status: waiting-for-triage The issue need to be evaluated and its future decided labels Feb 12, 2024
@artembilan artembilan modified the milestones: 6.3.0-M1, 6.3.0-M2 Feb 17, 2024
@artembilan artembilan modified the milestones: 6.3.0-M2, Backlog Mar 19, 2024
@artembilan artembilan modified the milestones: Backlog, 6.4.0-M1 Jun 4, 2024
EddieChoCho pushed a commit to EddieChoCho/spring-integration that referenced this issue Jun 26, 2024
…clearFetchedCache

Fixes: spring-projects#8898

In some cases not all retched remote files are processed, and after changing the `SessionFactory` (e.g. `RotatingServerAdvice`)
thy might not be processed on the next polling cycle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants