Hi all
I have a route, which checks for uniqueness of a certain value (find
duplicates, and in case of duplicates, the route will throw an exception).
That works fine so far.
At the end of the route, I want to clear the cache, so next time the route gets
executed, it shall start with an empty cache.
My question: How can I clear the cache at the end of the route?
My route(simplified)
from("direct:processArticles")
.split(xpath("//Article")) // for each Article
.setHeader("ArtEAN", xpath("Article/ArtEAN/text()"))
.idempotentConsumer(header("ArtEAN"),
MemoryIdempotentRepository.memoryIdempotentRepository(2000)).skipDuplicate(false)
.choice().when(header(Exchange.DUPLICATE_MESSAGE).isEqualTo(true)).throwException(ImportException.class,
"Line/Unit: ${exchangeProperty.CamelSplitIndex}: Found Duplicates").end()
// do some processing
.end()
Camel 3.20.3, Spring Boot 2.7.10