camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From martin11 <>
Subject Random unsuccessful read from file
Date Mon, 02 Dec 2013 14:59:26 GMT

I have a route triggered by timer where I read data (zulu time) from file
(using poolEnrich) and at the end of route I replace data in file for next
route iteration.

Now after deploy on server I found following problem:
- sometimes data are not loaded from file and poolEnrich return only 0x0a
(Line Feed) character! 
- from log I see that at the end of route valid data was ready for persist
into file
- I don`t understand why this happened after cca 200 successful iteration of
this route
- this anomaly happens 2 or 3 times per day (timer is set to 60s on server)
- there is no exception in log (Permission denied, Cannot store file, etc.)

Any idea why this could happen? Why pollEnrich read empty file? No other
process access to this new created file.
I use camel 2.11.0 and java 7.

Could not reproduce this problem on devel environment:

<camel:endpoint id="timeFile"
<camel:routeContext id="testRoutes">
    <camel:route id="route-test-file">
        <camel:pollEnrich ref="timeFile" strategyRef="enrichAggregation"/>
        <camel:log message="Data from file:${body}"/>
        <camel:convertBodyTo type="java.lang.String" />
            <camel:groovy>request.body != null ? request.body.trim() :
        <camel:log message="Save data to file:${body}"/>
        <camel:to ref="timeFile"/>

 * Enrich aggregator strategy implementation.
 * It keep original exchange message with all headers and properties
 * and only replace body with new value.
public class EnrichAggregationStrategy implements AggregationStrategy {

    public Exchange aggregate(Exchange originalExchange, Exchange
newExchange) {
        if (originalExchange == null) {
            originalExchange = newExchange;
        } else {

        return originalExchange;

Thanks for some hint.

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message