/** * Configure an {@link ExpressionEvaluatingMessageProcessor} that evaluates to a * {@link Map} of additional headers. They will be added to the inbound message * headers before evaluating the individual configured header specifications. * @param expression the expression. * @return the header enricher spec. * @see #messageProcessor(MessageProcessor) */ public HeaderEnricherSpec messageProcessor(String expression) { return messageProcessor(new ExpressionEvaluatingMessageProcessor<>(expression)); }
/** * Configure an * {@link org.springframework.integration.handler.MethodInvokingMessageProcessor} that * invokes the method on the bean - the method must return a {@link Map} of headers. * They will be added to the inbound message headers before evaluating the individual * configured header specifications. * @param beanName The bean name. * @param methodName The method name. * @return the header enricher spec. * @see #messageProcessor(MessageProcessor) */ public HeaderEnricherSpec messageProcessor(String beanName, String methodName) { return messageProcessor(new BeanNameMessageProcessor<>(beanName, methodName)); }
/** * Configure an {@link ExpressionEvaluatingMessageProcessor} that evaluates to a * {@link Map} of additional headers. They will be added to the inbound message * headers before evaluating the individual configured header specifications. * @param expression the expression. * @return the header enricher spec. * @see #messageProcessor(MessageProcessor) */ public HeaderEnricherSpec messageProcessor(String expression) { return messageProcessor(new ExpressionEvaluatingMessageProcessor<>(expression)); }
/** * Configure an * {@link org.springframework.integration.handler.MethodInvokingMessageProcessor} that * invokes the method on the bean - the method must return a {@link Map} of headers. * They will be added to the inbound message headers before evaluating the individual * configured header specifications. * @param beanName The bean name. * @param methodName The method name. * @return the header enricher spec. * @see #messageProcessor(MessageProcessor) */ public HeaderEnricherSpec messageProcessor(String beanName, String methodName) { return messageProcessor(new BeanNameMessageProcessor<Object>(beanName, methodName)); }
/** * Configure an * {@link org.springframework.integration.handler.MethodInvokingMessageProcessor} that * invokes the method on the bean - the method must return a {@link Map} of headers. * They will be added to the inbound message headers before evaluating the individual * configured header specifications. * @param beanName The bean name. * @param methodName The method name. * @return the header enricher spec. * @see #messageProcessor(MessageProcessor) */ public HeaderEnricherSpec messageProcessor(String beanName, String methodName) { return messageProcessor(new BeanNameMessageProcessor<>(beanName, methodName)); }
/** * Configure an * {@link org.springframework.integration.handler.MethodInvokingMessageProcessor} that * invokes the method on the bean - the method must return a {@link Map} of headers. * They will be added to the inbound message headers before evaluating the individual * configured header specifications. * @param beanName The bean name. * @param methodName The method name. * @return the header enricher spec. * @see #messageProcessor(MessageProcessor) */ public HeaderEnricherSpec messageProcessor(String beanName, String methodName) { return messageProcessor(new BeanNameMessageProcessor<Object>(beanName, methodName)); }
/** * Configure an {@link ExpressionEvaluatingMessageProcessor} that evaluates to a * {@link Map} of additional headers. They will be added to the inbound message * headers before evaluating the individual configured header specifications. * @param expression the expression. * @return the header enricher spec. * @see #messageProcessor(MessageProcessor) */ public HeaderEnricherSpec messageProcessor(String expression) { return messageProcessor(new ExpressionEvaluatingMessageProcessor<Object>(PARSER.parseExpression(expression))); }
/** * Configure an {@link ExpressionEvaluatingMessageProcessor} that evaluates to a * {@link Map} of additional headers. They will be added to the inbound message * headers before evaluating the individual configured header specifications. * @param expression the expression. * @return the header enricher spec. * @see #messageProcessor(MessageProcessor) */ public HeaderEnricherSpec messageProcessor(String expression) { return messageProcessor(new ExpressionEvaluatingMessageProcessor<Object>(PARSER.parseExpression(expression))); }
@Bean public IntegrationFlow xpathHeaderEnricherFlow() { return IntegrationFlows.from("xpathHeaderEnricherInput") .enrichHeaders( s -> s.header("one", new XPathExpressionEvaluatingHeaderValueMessageProcessor("/root/elementOne")) .header("two", new XPathExpressionEvaluatingHeaderValueMessageProcessor("/root/elementTwo")) .headerChannelsToString("12345") .messageProcessor(m -> s.header("foo", "bar")), c -> c.autoStartup(false).id("xpathHeaderEnricher") ) .get(); }