from(routeA)
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
//Point X
int requestId = logRequestToDatabase(exchange.getIn().getBody(String.class));
// need to use this requestId at point Y and Z..
}
})
.wireTap(routeT)
.to(routeB)
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
//Point Y
// i need the requestId from X here to mark it to log the response to database...
}
});
from(routeT)
.to(routeC)
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
//Point Z
// i need the requestId from X here to mark it to log the response to database...
}
});
我需要点 X 是异步的。我希望requestId
X 点中所示的在 Y 和 Z 中可用。这是因为,记录到数据库需要时间,我希望它是异步的,这样它就不会影响性能。请帮我。