}
@Override
public void process(Exchange exchange) throws Exception {
JsonElement json = getBodyAsJsonElement(exchange);
Response save = saveJsonElement(json);
if (save == null) {
throw new CouchDbException("Could not save document [unknown reason]", exchange);
}
if (log.isTraceEnabled()) {
log.trace("Document saved [_id={}, _rev={}]", save.getId(), save.getRev());
}
exchange.getIn().setHeader(CouchDbConstants.HEADER_DOC_REV, save.getRev());
exchange.getIn().setHeader(CouchDbConstants.HEADER_DOC_ID, save.getId());
}