0
public class AddingToCache extends RouteBuilder {
public void configure() {
from("jms:cacheTest")
.log("START")
.setHeader("CamelCacheOperation", constant("CamelCacheAdd"))
.setHeader("CamelCacheKey", constant("Custom_key"))
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
exchange.getOut().setBody("${body.customerDetails.firstName}");
}
})
.log("starting ...")
.to("cache://cache1?maxElementsInMemory=1000&eternal=true")
.to("direct:next");
}
}
我試圖用駱駝緩存首次和不斷收到錯誤未指定找到任何指向如何解決這個問題的東西。CamelCacheOperation頭的消息
謝謝克勞斯的回答!它正確地解決了我的問題! – Sammy65