Introduce HeaderFilterSpec to streamline DSL API #8636
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The concern has been driven by the discussion from: #8625 The point is that Java method arguments are not so descriptive when we read the code. Therefore, it is better to design DSL the way it would be cleaner from reading perspective. Plus less choice of methods to chain would give a better end-user experience from coding.
HeaderFilterSpec
which can acceptheadersToRemove
andpatternMatch
as individual options instead of top-level deprecatedheaderFilter(headersToRemove, patternMatch)
IntegrationFlow
method. This way Kotlin and Groovy DSLs get a gain from their "inner section" style.Consumer<HeaderFilterSpec>
way to configure an endpoint is similar to already existingaggregate(Consumer<AggregatorSpec>)
,resequence(Consumer<ResequencerSpec>)
etc. In other words those components which has a dedicatedConsumerEndpointSpec
extension are OK from an idiomatic DSL style perspectiveHeaderFilter.setHeadersToRemove()
to make it working smoothly with this new DSL requirementsheaderFilter()
style into Kotlin and Groovy DSLsThis is just an initial work to surface an idea.
If it is OK, I'll slow continue with others to realign and simplify the paradox of choice.