/** * Provide the {@link HeaderFilter} to the current {@link StandardIntegrationFlow}. * @param headersToRemove the array of headers (or patterns) * to remove from {@link org.springframework.messaging.MessageHeaders}. * @return this {@link IntegrationFlowDefinition}. */ public B headerFilter(String... headersToRemove) { return this.headerFilter(new HeaderFilter(headersToRemove), null); }
/** * Provide the {@link HeaderFilter} to the current {@link StandardIntegrationFlow}. * @param headersToRemove the comma separated headers (or patterns) to remove from * {@link org.springframework.messaging.MessageHeaders}. * @param patternMatch the {@code boolean} flag to indicate if {@code headersToRemove} * should be interpreted as patterns or direct header names. * @return this {@link IntegrationFlowDefinition}. */ public B headerFilter(String headersToRemove, boolean patternMatch) { HeaderFilter headerFilter = new HeaderFilter(StringUtils.delimitedListToStringArray(headersToRemove, ",", " ")); headerFilter.setPatternMatch(patternMatch); return this.headerFilter(headerFilter, null); }
/** * Provide the {@link HeaderFilter} to the current {@link StandardIntegrationFlow}. * @param headersToRemove the array of headers (or patterns) * to remove from {@link org.springframework.messaging.MessageHeaders}. * @return this {@link IntegrationFlowDefinition}. */ public B headerFilter(String... headersToRemove) { return this.headerFilter(new HeaderFilter(headersToRemove), null); }
/** * Provide the {@link HeaderFilter} to the current {@link StandardIntegrationFlow}. * @param headersToRemove the array of headers (or patterns) * to remove from {@link org.springframework.messaging.MessageHeaders}. * @return this {@link IntegrationFlowDefinition}. */ public B headerFilter(String... headersToRemove) { return this.headerFilter(new HeaderFilter(headersToRemove), null); }
/** * Provide the {@link HeaderFilter} to the current {@link StandardIntegrationFlow}. * @param headersToRemove the array of headers (or patterns) * to remove from {@link org.springframework.messaging.MessageHeaders}. * @return this {@link IntegrationFlowDefinition}. */ public B headerFilter(String... headersToRemove) { return this.headerFilter(new HeaderFilter(headersToRemove), null); }
@Bean @SuppressWarnings("rawtypes") public IntegrationFlow splitResequenceFlow(MessageChannel executorChannel) { return f -> f.enrichHeaders(s -> s.header("FOO", "BAR")) .split("testSplitterData", "buildList", c -> c.applySequence(false)) .channel(executorChannel) .split(Message.class, Message::getPayload, c -> c.applySequence(false)) .channel(MessageChannels.executor(taskExecutor())) .split(s -> s .applySequence(false) .delimiters(",")) .channel(MessageChannels.executor(taskExecutor())) .<String, Integer>transform(Integer::parseInt) .enrichHeaders(h -> h.headerFunction(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER, Message::getPayload)) .resequence(r -> r.releasePartialSequences(true).correlationExpression("'foo'")) .headerFilter("foo", false); }
/** * Provide the {@link HeaderFilter} to the current {@link StandardIntegrationFlow}. * @param headersToRemove the comma separated headers (or patterns) to remove from * {@link org.springframework.messaging.MessageHeaders}. * @param patternMatch the {@code boolean} flag to indicate if {@code headersToRemove} * should be interpreted as patterns or direct header names. * @return this {@link IntegrationFlowDefinition}. */ public B headerFilter(String headersToRemove, boolean patternMatch) { HeaderFilter headerFilter = new HeaderFilter(StringUtils.delimitedListToStringArray(headersToRemove, ",", " ")); headerFilter.setPatternMatch(patternMatch); return this.headerFilter(headerFilter, null); }
/** * Provide the {@link HeaderFilter} to the current {@link StandardIntegrationFlow}. * @param headersToRemove the comma separated headers (or patterns) to remove from * {@link org.springframework.messaging.MessageHeaders}. * @param patternMatch the {@code boolean} flag to indicate if {@code headersToRemove} * should be interpreted as patterns or direct header names. * @return this {@link IntegrationFlowDefinition}. */ public B headerFilter(String headersToRemove, boolean patternMatch) { HeaderFilter headerFilter = new HeaderFilter(StringUtils.delimitedListToStringArray(headersToRemove, ",", " ")); headerFilter.setPatternMatch(patternMatch); return this.headerFilter(headerFilter, null); }
/** * Provide the {@link HeaderFilter} to the current {@link StandardIntegrationFlow}. * @param headersToRemove the comma separated headers (or patterns) to remove from * {@link org.springframework.messaging.MessageHeaders}. * @param patternMatch the {@code boolean} flag to indicate if {@code headersToRemove} * should be interpreted as patterns or direct header names. * @return this {@link IntegrationFlowDefinition}. */ public B headerFilter(String headersToRemove, boolean patternMatch) { HeaderFilter headerFilter = new HeaderFilter(StringUtils.delimitedListToStringArray(headersToRemove, ",", " ")); headerFilter.setPatternMatch(patternMatch); return this.headerFilter(headerFilter, null); }
@Bean public IntegrationFlow splitResequenceFlow() { return f -> f.enrichHeaders(s -> s.header("FOO", "BAR")) .split("testSplitterData", "buildList", c -> c.applySequence(false)) .channel(c -> c.executor(taskExecutor())) .split(Message.class, m -> m.getPayload(), c -> c.applySequence(false)) .channel(MessageChannels.executor(taskExecutor())) .split(s -> s .applySequence(false) .delimiters(",")) .channel(c -> c.executor(taskExecutor())) .<String, Integer>transform(Integer::parseInt) .enrichHeaders(h -> h.headerFunction(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER, Message::getPayload)) .resequence(r -> r.releasePartialSequences(true).correlationExpression("'foo'")) .headerFilter("foo", false); }