public void process(Exchange exchange) throws Exception { Message outMsg = exchange.getIn().copy(); exchange.setOut(outMsg); }
@Override public void process(org.apache.camel.Exchange exchange) throws Exception { Message in = exchange.getIn(); in.setHeader(OPERATION_SELECTOR_HEADER, _selector); exchange.setOut(in.copy()); }
@Override public void process(org.apache.camel.Exchange exchange) throws Exception { Message in = exchange.getIn(); in.setHeader(MESSAGE_COMPOSER_HEADER, _composer); exchange.setOut(in.copy()); }
@Override public void process(org.apache.camel.Exchange exchange) throws Exception { Message in = exchange.getIn(); in.setHeader(OPERATION_SELECTOR_HEADER, _selector); exchange.setOut(in.copy()); }
@Override public void process(org.apache.camel.Exchange exchange) throws Exception { Message in = exchange.getIn(); in.setHeader(MESSAGE_COMPOSER_HEADER, _composer); exchange.setOut(in.copy()); }
public static void processHeaders(Exchange e) throws Exception { e.setOut(e.getIn()); Message msg_out = e.getOut(); if (e.getIn().getHeader("org.restlet.http.headers") != null) {
exchange.setOut(exchange.getIn());
private void addData() { Object body; if (data.size() == 0) { body = null; } else if (data.size() == 1) { body = data.get(0); } else { body = data; } if (body instanceof Exchange && !exchange.equals(body)) { // copy into the original Exchange Exchange copy = (Exchange) body; exchange.setException(copy.getException()); exchange.setIn(copy.getIn()); exchange.setOut(copy.getOut()); exchange.getProperties().clear(); exchange.getProperties().putAll(copy.getProperties()); } else { exchange.getOut().setBody(body); } }
void finish(final Message result) { for (final Closeable closeable : closables) { IoUtils.safeClose(closeable); } if (result != null) { if (ExchangeHelper.isOutCapable(exchange)) { exchange.setOut(result); } else { exchange.setIn(result); } } callback.done(false); }
@Override public void process(Exchange exchange) throws Exception { // NOPMD all // exceptions must // be caught to // react on // exception case // and re-thrown, // see code below InputStream stream = exchange.getIn().getMandatoryBody(InputStream.class); try { // lets setup the out message before we invoke the dataFormat // so that it can mutate it if necessary Message out = exchange.getOut(); out.copyFrom(exchange.getIn()); if (config.isFromBase64(exchange)) { stream = new Base64InputStream(stream); } Object result = unmarshalInternal(stream, exchange); out.setBody(result); } catch (Throwable e) { // remove OUT message, as an exception occurred exchange.setOut(null); throw e; } finally { IOHelper.close(stream, "input stream"); } }
protected void processSignedDataHeader(Exchange exchange, InputStream signature) throws Exception { // NOPMD // all exceptions must be caught and re-thrown in order to make a // clean-up, see code below if (conf.isSignedDataHeaderBase64(exchange)) { signature = new Base64InputStream(signature); } InputStream stream = exchange.getIn().getMandatoryBody(InputStream.class); try { // lets setup the out message before we invoke the dataFormat // so that it can mutate it if necessary Message out = exchange.getOut(); out.copyFrom(exchange.getIn()); if (conf.isFromBase64(exchange)) { stream = new Base64InputStream(stream); } unmarshalInternal(stream, signature, exchange); } catch (Exception e) { // remove OUT message, as an exception occurred exchange.setOut(null); throw e; } finally { IOHelper.close(stream, "input stream"); } }
@Override public void process(Exchange exchange) throws Exception { // NOPMD all // exceptions must be caught to react on exception case and re-thrown, // see code below OutputStreamBuilder output = OutputStreamBuilder.withExchange(exchange); OutputStream outStream; if (config.getToBase64()) { outStream = new Base64OutputStream(output); } else { outStream = output; } InputStream body = exchange.getIn().getMandatoryBody(InputStream.class); // lets setup the out message before we invoke the processing // so that it can mutate it if necessary Message out = exchange.getOut(); out.copyFrom(exchange.getIn()); try { try { marshalInternal(body, outStream, exchange); } finally { IOHelper.close(outStream); // base64 stream must be closed, // before we fetch the bytes } setBodyAndHeader(out, output.build()); } catch (Throwable e) { // remove OUT message, as an exception occurred exchange.setOut(null); throw e; } }
private Message compose(Exchange exchange) throws Exception { Message camelMsg; if (_messageComposer != null) { camelMsg = getCamelMessage(); _messageComposer.decompose(exchange, new CamelBindingData(camelMsg)); } else { camelMsg = ExchangeMapper.mapSwitchYardToCamel(exchange, _camelExchange); if (isInOnly()) { _camelExchange.setIn(camelMsg); } else { _camelExchange.setOut(camelMsg); } } return camelMsg; } }
exchange.setOut(result); } else { exchange.setIn(result);
private Message compose(Exchange exchange) throws Exception { Message camelMsg; if (_messageComposer != null) { camelMsg = getCamelMessage(); _messageComposer.decompose(exchange, new CamelBindingData(camelMsg)); } else { camelMsg = ExchangeMapper.mapSwitchYardToCamel(exchange, _camelExchange); if (isInOnly()) { _camelExchange.setIn(camelMsg); } else { _camelExchange.setOut(camelMsg); } } return camelMsg; }
exchange.setOut(exchange.getIn().copy()); exchange.getOut().setBody(response);
exchange.setOut(camelResponse);
exchange.setOut(camelResponse);
private void updateExchangeWithResult(ProductionContext context, OperationResult result) { ZooKeeperMessage out = new ZooKeeperMessage(getEndpoint().getCamelContext(), context.node, result.getStatistics(), context.in.getHeaders()); if (result.isOk()) { out.setBody(result.getResult()); } else { context.exchange.setException(result.getException()); } context.exchange.setOut(out); }
exchange.setOut(replyMessage); //Swap out the outbound message