I'm trying to implement caching with camel-cache. The Idea is to cache the results of a mybatis query on a table update. I'm looking at something that would automatically flush the cache for the key, run the mybatis query and cache its result again?
A restlet endpoint would look into the cache and produce a response.
> I'm looking at something that
> would automatically flush the cache for the key, run the mybatis query and
> cache its result again?
No such thing out of the box. You need to control the cache by
explicit calls to camel-cache operations. You can however consider
using interceptors  to partially automate such calls in the AOP
> Having a trigger seems to be a simple solution, but does *camel provide a
> way to listen to a DB trigger*?
You can use trigger to invoke Camel endpoint. For example in Postgres
you can write modules in PL/Python  and invoke HTTP Netty endpoint
exposed by Camel. Messages from that endpoint can be routed to
invalidate the cache.