/** * Process the outbound {@link HandlerChain} for the message context, if any. * * @param messageContext the message context to process * @throws MessageEncodingException thrown if a handler indicates a problem handling the message */ protected void processOutboundHandlerChain(MessageContext messageContext) throws MessageEncodingException { HandlerChainResolver outboundHandlerChainResolver = messageContext.getOutboundHandlerChainResolver(); if (outboundHandlerChainResolver != null) { log.debug("Invoking outbound handler chain on message context"); try { for (HandlerChain outboundHandlerChain : outboundHandlerChainResolver.resolve(messageContext)) { if (outboundHandlerChain != null) { invokeHandlerChain(outboundHandlerChain, messageContext); } } } catch (HandlerException e) { log.error("Encountered HandlerException when encoding message: {}", e.getMessage()); throw new MessageEncodingException("Handler exception while encoding message", e); } } }
/** * Process the outbound {@link HandlerChain} for the message context, if any. * * @param messageContext the message context to process * @throws MessageEncodingException thrown if a handler indicates a problem handling the message */ protected void processOutboundHandlerChain(MessageContext messageContext) throws MessageEncodingException { HandlerChainResolver outboundHandlerChainResolver = messageContext.getOutboundHandlerChainResolver(); if (outboundHandlerChainResolver != null) { log.debug("Invoking outbound handler chain on message context"); try { for (HandlerChain outboundHandlerChain : outboundHandlerChainResolver.resolve(messageContext)) { if (outboundHandlerChain != null) { invokeHandlerChain(outboundHandlerChain, messageContext); } } } catch (HandlerException e) { log.error("Encountered HandlerException when encoding message: {}", e.getMessage()); throw new MessageEncodingException("Handler exception while encoding message", e); } } }