I don't think that the persistence configuration influences how the cache
component writes the exchanges into the cache.
When performing add or update operations, the
*org.apache.camel.component.cache.CacheProducer* class uses its
createElementFromBody() method which takes the in message body from the
exchange and creates a cache element from it. The message headers are not
considered at all, thus the headers loss.

Unfortunately, it seems that whether headers should be considered when
creating the cache element is not customizable.

*@Camel team*: what is you recommendation for this use case: we put some
custom headers when creating a message and need them on the consumer side
(after they have been sent to and consumed from the cache component)?
One option would be to story the headers as part of the body before passing
the message to the cache, and then extracting them back from it before the
consumed message is passed to the processor, but will add overhead that we
would like to avoid.

Best regards,
Atanas



--
View this message in context: 
http://camel.465427.n5.nabble.com/Persist-headers-when-using-cache-tp5744069p5744244.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to