Re: Problems configuring FileIdempotentRepository

2014-11-01 Thread Claus Ibsen
Hi

Yeah the code in doStart / loadStore should create the file store if
it does not exists. Then Camel will create the store on startup, and
the file is there.

I logged  ticket to get this fixed
https://issues.apache.org/jira/browse/CAMEL-7989

On Wed, Oct 29, 2014 at 4:57 PM, Henryk Konsek hekon...@gmail.com wrote:
 The underlying problem is that if the idempotent repository file doesn't
 exist Camel doesn't seem to create it.

 If you can reproduce the issue with the Maven example, you could
 create a Jira issue with bug report.

 Cheers.


 --
 Henryk Konsek
 http://henryk-konsek.blogspot.com



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: Problems configuring FileIdempotentRepository

2014-10-29 Thread Henryk Konsek
 The underlying problem is that if the idempotent repository file doesn't
 exist Camel doesn't seem to create it.

If you can reproduce the issue with the Maven example, you could
create a Jira issue with bug report.

Cheers.


-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Problems configuring FileIdempotentRepository

2014-10-28 Thread Knut-Håvard Aksnes
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=5120 /
/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 = 51)
public void issueImport() throws InterruptedException, IOException {
Assert.assertNotNull(issuesFetched);
   
Assert.assertEquals(issuesImported.dat,issuesFetched.getFilePath());
Assert.assertEquals(5120L, issuesFetched.getMaxFileStoreSize());
Assert.assertEquals(5000, issuesFetched.getCacheSize());
Thread.sleep(50);
}

}

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.


Re: Problems configuring FileIdempotentRepository

2014-10-28 Thread Knut-Håvard Aksnes
I am using Camel 2.12.4

This doesn't help so I assume that the problem isn't related to the
cacheSize setter:

bean id=issuesFetched

class=org.apache.camel.processor.idempotent.FileIdempotentRepository
factory-method=fileIdempotentRepository
constructor-arg name=fileStore value=issuesImported.dat /
constructor-arg name=cacheSize value=5000 /
constructor-arg name=maxFileStoreSize value=5120 /
/bean



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


Re: Problems configuring FileIdempotentRepository

2014-10-28 Thread Knut-Håvard Aksnes
The underlying problem is that if the idempotent repository file doesn't
exist Camel doesn't seem to create it. If I create it as an empty file the
repository seems to always be truncated during the save phase: Even with
only a few files there and a with a huge file store size.
In the last case I get this message after reading only 6 files with a
maxFileStoreSize of 2  :
2014-10-28 16:44:18,533 INFO  FileIdempotentRepository - Trunking idempotent
filestore: issuesImported.dat

The repository is left empty.




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