Hello Claus,
I have one more question. This is the working route, as per your advice:
from(startEndpoint)
.choice()
.when(fileIsNotComplete())
.to(tempEndpoint)
.otherwise()
.delay(5 * COMPLETION_TIMEOUT)
.process(processor).to(outputEndpoint);
from(tempEndpoint)
.aggregate(new ObjectsAggregator()).constant(true)
.completionSize(BATCH_SIZE).completionTimeout(COMPLETION_TIMEOUT)
.process(processor).stop();
My purpose is to process all the exchanges that come from a file, through a
couple of routes that do extra processing, but allow only for the last
exchange, which is detected inside "fileIsNotComplete", to go to a final
endpoint and set a "file done" flag into the database, so that the first
route of the business logic can start processing another file.
Even though the process method is synchronized and I inserted the big delay,
there are situations when the final exchange, the one going to the "when()"
choice, gets its turn to be processed before other batches of exchanges,
from the "otherwise" choice, which are waiting in line.
Is there a way to pause/forbid route "when" to do its job until route
"otherwise" will have finished everything?
Thanks.
--
View this message in context:
http://camel.465427.n5.nabble.com/Mixing-ChoiceDefinition-with-DelayDefinition-tp5734524p5734708.html
Sent from the Camel - Users mailing list archive at Nabble.com.