camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Önder Sezgin (JIRA) <j...@apache.org>
Subject [jira] [Comment Edited] (CAMEL-12058) Wrong order in file idempotent store.
Date Mon, 18 Dec 2017 08:20:00 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-12058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16294637#comment-16294637
] 

Önder Sezgin edited comment on CAMEL-12058 at 12/18/17 8:19 AM:
----------------------------------------------------------------

There is a discussion around FIFO based caching..
https://github.com/ben-manes/caffeine/issues/183
This may help considering [~sermojohn]'s comment.
Not sure if it is easy to replace LRUCache in FileIdempotentRepository with a new one and
see the side effects.
and not sure if it would be good to introduce such caching in camel-core.
maybe it is good [~davsclaus] comment as well..




was (Author: onders):
There is a discussion around FIFO based caching..
https://github.com/ben-manes/caffeine/issues/183
This may help considering [~sermojohn]'s comment.
Not sure if it is easy to replace LRUCache in FileIdempotentRepository with a new and see
the side effects.
and not sure if sure it would be good to introduce such caching in camel-core.
maybe it is good [~davsclaus] comment as well..



> Wrong order in file idempotent store.
> -------------------------------------
>
>                 Key: CAMEL-12058
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12058
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.20.1, 2.20.2, 2.21.0
>            Reporter: Krzysztof Hołdanowicz
>            Priority: Minor
>              Labels: FileIdempotent
>             Fix For: 2.20.2
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I recently noticed that there is wrong entry order in file using 
> FileIdempotentRepository implementation. 
> The effect is that instead of having order like: 
> file1.txt.20171123 
> file2.txt.20171123 
> file1.txt.20171124 
> file3.txt.20171125 
> file2.txt.20171126 
> we have: 
> file1.txt.20171123 
> file1.txt.20171124 
> file2.txt.20171123 
> file2.txt.20171126 
> file3.txt.20171125 
> where date extension represents order in which particular file was consumed 
> by the idempotent file consumer. 
> As a consequence instead of initializing memory cache with newest values, 
> it is initialized (probably) based on hash function from truncStore method 
> and we consume same file more than once: 
>     protected void trunkStore() { 
>         LOG.info("Trunking idempotent filestore: {}", fileStore); 
>         FileOutputStream fos = null; 
>         try { 
>             fos = new FileOutputStream(fileStore); 
>             for (String key : cache.keySet()) { 
>                 fos.write(key.getBytes()); 
>                 fos.write(STORE_DELIMITER.getBytes()); 
>             } 
>         } catch (IOException e) { 
>             throw ObjectHelper.wrapRuntimeCamelException(e); 
>         } finally { 
>             IOHelper.close(fos, "Trunking file idempotent repository", LOG); 
>         } 
>     } 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message