Description
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.