camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Johnson <brad.john...@mediadriver.com>
Subject Re: Camel BeanIODataFormat Configure ErrorHandler for BeanIO Reader
Date Fri, 02 Sep 2016 00:58:19 GMT
By the way, I almost forgot to ask. How big are your input files?  If they
aren't enormous you can unmarshal the whole file in one gulp and if
something is not right it will break right there without any processing. If
it succeeds you simply iterate over the now unmarshaled beans.

On Thu, Sep 1, 2016 at 1:03 PM, Brad Johnson <brad.johnson@mediadriver.com>
wrote:

> If that works then great.  If you want to reject the file you'll likely
> have to run the file twice.  The first for validation and the second for
> processing.  Remember if you're streaming these and processing them and
> then get a bad record like the one with the missing field, you've already
> processed a good number of records and won't be able to reject the file.
> Either that or you'll have to get into some sort of transaction and
> rollback.
>
> Brad
>
> On Wed, Aug 31, 2016 at 1:50 PM, spurcell <scott_purcell@mastercard.com>
> wrote:
>
>> Hello Brad,
>>
>> Here is an expected file (simplified down for discussion)
>> "FHDR","1","t","20160"
>> "LFHDR","p","4","2016"
>> "TRNSFRREQ","p","2","A","4","U","a"
>> "LFTRLR","p","1","4"
>> "FTRLR","5","4"
>>
>>
>> When a user sends in a bad file (2 FHDR files) I want to reject the file.
>> "FHDR","1","t","20160"
>> "FHDR","1","t","20160"
>> "LFHDR","p","4","2016"
>> "TRNSFRREQ","p","2","A","4","U","a"
>> "LFTRLR","p","1","4"
>> "FTRLR","5","4"
>>
>> If a user sends in a record with a missing field (LFHDR missing the "4"
>> column) I would like to capture that in the reader and reject the file.
>>
>> "FHDR","1","t","20160"
>> "LFHDR","p","2016"
>> "TRNSFRREQ","p","2","A","4","U","a"
>> "LFTRLR","p","1","4"
>> "FTRLR","5","4"
>>
>> I did figure out that using 2.18.0-SNAPSHOT works and one can now insert a
>> Handler so I am debugging that right now.
>>
>> Thanks
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.
>> com/Camel-BeanIODataFormat-Configure-ErrorHandler-for-BeanIO
>> -Reader-tp5787005p5787071.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message