I have had problems with a FileIdempotentRepository configured like this
(spring):

        <bean id="issuesFetched"
                
class="org.apache.camel.processor.idempotent.FileIdempotentRepository">
                <property name="fileStore" value="issuesImported.dat" />
                <property name="cacheSize" value="5000" />
                <property name="maxFileStoreSize" value="51200000" />
        </bean>

I then in a test case


@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
"/META-INF/spring/pays-issue-import-test.xml" })
public class ITIssueImport {

    @Inject
    @Named("issuesFetched")
    FileIdempotentRepository issuesFetched;

    @Test(timeout = 510000)
    public void issueImport() throws InterruptedException, IOException {
        Assert.assertNotNull(issuesFetched);
       
Assert.assertEquals("issuesImported.dat",issuesFetched.getFilePath());
        Assert.assertEquals(51200000L, issuesFetched.getMaxFileStoreSize());
        Assert.assertEquals(5000, issuesFetched.getCacheSize());
        Thread.sleep(500000);
    }

}

It fails at the last assert, telling me that cache size is null.

I need to set the value to something larger than 0 as a cache with a fixed
maximum size of 0 is useless.
I am trying to use this on a file route where I have to use noop=true and
need to avoid rereading files after a restart. My spring configuration is
based on documentation for the file component.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Problems-configuring-FileIdempotentRepository-tp5758212.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to