I am trying to use ftp-inbound-adapter to poll files based on the the current date.And my inbound adapter uses a filter which refers to bean myfilter .The problem here is the current date is initailized at the startup and is not been processed dynamically..I would like to get the current date for every new message
<int-ftp:inbound-channel-adapter id="ftpInbound"
channel="ftpChannel"
session-factory="ftpsClientFactory"
filter="myFilter"
</int-ftp:inbound-channel-adapter>
<bean id="myFilter" class="org.springframework.integration.ftp.filters.FtpRegexPatternFileListFilter" scope="prototype">
<constructor-arg value="#{T(java.time.LocalDateTime).now().format(T(java.time.format.DateTimeFormatter).ofPattern('MMddyy'))}.(xls|xlsx)"/>
<aop:scoped-proxy/>
</bean>
UPDATE
I changed from this
<bean id="currentDate" class="java.util.Date" factory-bean="fastDateFormat"
scope="prototype" factory-method="format" >
<aop:scoped-proxy/>
<constructor-arg>
<bean class="java.util.Date" />
</constructor-arg>
</bean>
<bean id="myFilter" class="org.springframework.integration.ftp.filters.FtpRegexPatternFileListFilter" scope="prototype">
<constructor-arg value="#{currentDate}.(xls|xlsx)"/>
</bean>
And my inbound adapter uses a filter which refers to bean myFilter .. The problem here is the current date is initailized at the startup and is not been processed dynamically..I would like to get the current date for every new message