spring-projects / spring-projects/spring-integration

Global SpelExpressionParser Suport [INT-3562]

Open
#7,525 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: core type: enhancement
Dominant language
Java
Stars
1.6k
Forks
1.2k
Avg merge
17h 48m
Merged PRs (30d)
62

Description

Gary Russell opened INT-3562 and commented

The SpEL compiler can be enabled globally or on individual SpEL parsers.

Currently Spring Integration components do not provide support at the parser level, they each instantiate their own parser.

It would be useful if components can obtain an appropriate parser during initialization. Perhaps via some central registry; something like:

<int:spel-parser id="mixed" compiler-mode="MIXED" pattern="foo*, myAdapter.source, *.handler" />
<int:spel-parser id="immediate" compiler-mode="IMMEDIATE" pattern="bar" />

together with registry.getParserFor(getBeanName()).

Components that use several expressions may want to use a different parser for each; so some solution is needed for that situation.

It might not be too bad to support a Map under a well-known bean name:

<util:map id="integrationExpressionParsers">
    <entry key="ftpOut.remoteDirectoryExpression" value-ref="immediate" />
</util:map>

and registry.getParserFor(getBeanName(), "remoteDirectoryExpression").

The previous work to enable central configuration of the evaluation context means that all components that evaluate expressions should now have access to the BeanFactory so this should not be too hard to implement.


Reference URL: http://docs.spring.io/spring-framework/docs/current/spring-framework-reference/html/expressions.html#expressions-spel-compilation

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Spring Integration components that instantiate their own SpEL parsers and the existing BeanFactory-based evaluation-context configuration. Read the linked Spring Framework SpEL compilation reference for parser behavior. Done would require an agreed design supporting centrally configured parsers, including selection by component and by expression where needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.