camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Robson <glen.rob...@llgc.org.uk>
Subject Throwing exceptions from Enrichers
Date Fri, 26 Nov 2010 08:48:55 GMT
Hi,

I was wondering what the best way to throw an exception from an  
aggregator is so I can catch it in the camel route. Currently I have  
the following route:

<route>
             <from uri="jms:ethos_marc_loaded" />
             <bean ref="marc2marcxml" />
             <setHeader headerName="CamelHttpUri">
                 <simple>http://localhost:8888/ethos/upload/$ 
{header.llgc_ethos_oai_harvest_location}/$ 
{header.llgc_ethos_transaction_id}/mets.xml</simple>
             </setHeader>
             <enrich uri="http://localhost:8888"  
strategyRef="AddBibIdsToMETS" />
             <to uri="jms:ethos_ingest" />
</route>

<bean id="AddBibIdsToMETS"  
class="uk.org.llgc.projects.ethos.AddBibIdsToMETS" />

AddBibIdsToMETS is a custom aggregation strategy implementing the  
org.apache.camel.processor.aggregate.AggregationStrategy interface and  
it implements the following method:

Exchange aggregate(Exchange oldExchange, Exchange newExchange)
which means I can't just throw the exception from the method.

Whats the best way to get round this?

Thanks for your help

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