camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doug5791 <>
Subject Re: Camel: How to stop a route temporarily?
Date Tue, 25 Mar 2014 19:14:28 GMT
I am currently trying to use the "Exchange.ROUTE_STOP" property -I do not
think that using a CountDownLatch will work out-, however I do not get the
desired effect. Using the code below, only the last Exchange goes on to the

//exAr is a List of Exchanges
.process(new Processor()
	                	public void process(Exchange exchange) throws Exception
	                		//Check if cache is not full, add the exchange, set
exchange to stop
	                		if(exAr.size() < CACHEMAXSIZE)
	                			exchange.setProperty(Exchange.ROUTE_STOP, Boolean.TRUE);
	                		//Check if cache is full, iterate exchanges and set to
go, clear cache
	                		if(exAr.size() == CACHEMAXSIZE)
	                			for(int i = 0; i < CACHEMAXSIZE; i++)
	                			cacheSize = 0;
According to the documentation on using ROUTE_STOP this should be what I'm
looking for. However only the last item in the List is sent on to the

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

View raw message