private void logRouteStart(Exchange exchange) { //UnitOfWork -> getRouteContext -> Route -> Id. String routeId = exchange.getUnitOfWork().getRouteContext().getRoute().getId(); WonMessage message = (WonMessage) exchange.getIn().getHeader(WonCamelConstants.MESSAGE_HEADER); if (message == null){ logger.debug("starting route {}: [no WoNMessage]", routeId); return; } logger.debug("starting route {}: {} type:{}, dir:{}, resp:{}, rem: {}", new String[]{ routeId, message.getMessageURI().toString(), message.getMessageType().toString(), message.getEnvelopeType().toString(), message.getIsResponseToMessageURI() == null ? "[not a response]" : message.getIsResponseToMessageURI().toString(), message.getCorrespondingRemoteMessageURI() == null ? "[no remote message uri]" : message.getCorrespondingRemoteMessageURI().toString() }); }
/** * Find and configure an unmarshaller for the specified data format. */ private synchronized MarshalProcessor resolveMarshaller( Exchange exchange, String dataFormatId) throws Exception { if (marshaller == null) { DataFormat dataFormat = DataFormatDefinition.getDataFormat( exchange.getUnitOfWork().getRouteContext(), null, dataFormatId); if (dataFormat == null) { throw new Exception("Unable to resolve data format for marshalling: " + dataFormatId); } // Wrap the data format in a processor and start/configure it. // Stop/shutdown is handled when the corresponding methods are // called on this producer. marshaller = new MarshalProcessor(dataFormat); marshaller.setCamelContext(exchange.getContext()); marshaller.start(); } return marshaller; }
/** * Find and configure an unmarshaller for the specified data format. */ private synchronized UnmarshalProcessor resolveUnmarshaller( Exchange exchange, String dataFormatId) throws Exception { if (unmarshaller == null) { DataFormat dataFormat = DataFormatDefinition.getDataFormat( exchange.getUnitOfWork().getRouteContext(), null, dataFormatId); if (dataFormat == null) { throw new Exception("Unable to resolve data format for unmarshalling: " + dataFormatId); } // Wrap the data format in a processor and start/configure it. // Stop/shutdown is handled when the corresponding methods are // called on this producer. unmarshaller = new UnmarshalProcessor(dataFormat); unmarshaller.setCamelContext(exchange.getContext()); unmarshaller.start(); } return unmarshaller; }
this.currentRouteId = (source.getUnitOfWork() == null || source.getUnitOfWork().getRouteContext() == null) ? null : source.getUnitOfWork().getRouteContext().getRoute().getId(); this.breadCrumbId = getBreadCrumbId(source); this.exception = source.getException() == null ? source.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class) : source.getException();