In the message body or context headers. How are you reading from the DB? Usually this will get the data into the message body.
Why don't you just run a camel route directly from the scheduler every time you get data from DB? Once you put it somewhere outside of transaction, the data consistency would be lost.
As per jmorales he says that "as a request is synchronous, the data that you read from the DB gets lost, no matter what you use (context, body) after you have processed that request"
Sounds like i must use cache. Was checking in infinispan and was trying to add was tring to add <to uri="infinispan://localhost?cacheContainer=#cacheContainer&caseName=orders"/> to my route but i got the bellow exception:
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: infinispan://localhost?cacheContainer=%23cacheContainer&caseName=orders due to: No component found with scheme: infinispan
Any idea what is missing?
Oh ok. Thanks for the input Tomohisa!
Any idea on when it will be fully supported?
What other cache alternatives do i have?
as I mentioned in the irc, you can use Infinispan in Java (in a Java component) or a Java processor (in a camel component) if the infinispan camel component gets complicated to you. It should be very simple to create, and you should find some examples on how to use Infinispan from java in a EE world.
Unfortunately we don't have a plan to support camel-infinispan right now. AFAIK JBoss Fuse doesn't yet support camel-infinispan as well. If you have a subscription for FSW, you may want to file a feature request through the customer support. But IMO still infinispan is a first option for on-memory cache as its jar is already in the distribution.