Just combine the two currencies into one string and use that as the unique value...
2014-12-03 9:52 GMT+01:00 contactreji <contactr...@gmail.com>: > Hi > > I have a requirement where I need to omit duplicate records. Consider > sample > below > > *<ExchangeRates> > <Rate> > <SourceCurrency>INR<SourceCurrency> > <TargetCurrency>USD<TargetCurrency> > <ConversionFactor>60.2<ConversionFactor> > </Rate> > <Rate> > <SourceCurrency>INR<SourceCurrency> > <TargetCurrency>USD<TargetCurrency> > <ConversionFactor>58.2<ConversionFactor> > </Rate> > <Rate> > <SourceCurrency>YEN<SourceCurrency> > <TargetCurrency>INR<TargetCurrency> > <ConversionFactor>.52<ConversionFactor> > </Rate> > <Rate> > <SourceCurrency>SAR<SourceCurrency> > <TargetCurrency>INR<TargetCurrency> > <ConversionFactor>16.50<ConversionFactor> > </Rate> > </ExchangeRates>* > > > > Now what i wanna do is remove all duplicates. As well as if there is same > pair of Source and TargetCurrency , I want to send ahead the first record > and drop others. > > Output shud be like > > *<ExchangeRates> > <Rate> > <SourceCurrency>INR<SourceCurrency> > <TargetCurrency>USD<TargetCurrency> > <ConversionFactor>60.2<ConversionFactor> > </Rate> > <Rate> > <SourceCurrency>YEN<SourceCurrency> > <TargetCurrency>INR<TargetCurrency> > <ConversionFactor>.52<ConversionFactor> > </Rate> > <Rate> > <SourceCurrency>SAR<SourceCurrency> > <TargetCurrency>INR<TargetCurrency> > <ConversionFactor>16.50<ConversionFactor> > </Rate> > </ExchangeRates>* > > Is there any camel component which can help me achieve this?? > > Is there away I can use Idempotent Consumer. Cuz I saw that in idempotent > consumer, we can use only 1 unique value to verify duplicacy. Can i use 2 > set of values to verify duplicacy? > Ex - I want to allow only one set of USD->INR rate once in a day. > > Cheers > Reji > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Duplicate-Elimination-tp5760020.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- -- David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen