spring integration - PropertiesPersistingMetadataStore not writing to file -
i using sftpsimplepatternfilelistfilter , sftppersistentacceptoncefilelistfilter along metadata store. noticed not flushing entries file. never show flush() method being called propertiespersistingmetadatastore invokes savemetadata() method.
here config looks
<bean id="compositefilter" class="org.springframework.integration.file.filters.compositefilelistfilter"> <constructor-arg> <list> <bean class="org.springframework.integration.sftp.filters.sftpsimplepatternfilelistfilter"> <constructor-arg value="*.txt" /> </bean> <bean class="org.springframework.integration.sftp.filters.sftppersistentacceptoncefilelistfilter"> <constructor-arg name="store" ref="metadatastore"/> <constructor-arg value="myapp"/> </bean> </list> </constructor-arg> </bean> <bean name="metadatastore" class="org.springframework.integration.metadata.propertiespersistingmetadatastore"> <property name="basedirectory" value="/tmp/"/> </bean>
by default propertiespersistingmetadatastore
flushes file on applicationcontext
destroy:
@override public void close() throws ioexception { flush(); } @override public void flush() { savemetadata(); } @override public void destroy() throws exception { flush(); }
starting 4.1.2
can invoke flush()
manually @ runtime. e.g. periodically <task:sheduled-tasks>
or <int:outbound-channel-adapter>
.
feel free ask more information!
Comments
Post a Comment