spring-projects / spring-projects/spring-integration
Allow for non-void method calls in outbound channel adapter expression [INT-3815]
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.6k
- Forks
- 1.2k
- Avg merge
- 17h 48m
- Merged PRs (30d)
- 62
Description
Mauro Molinari opened INT-3815 and commented
Right now, the SpEL expression I specify on an <int:outbound-channel-adapter> requires a void-returning expression, otherwise an exception is thrown.
However, this is limiting. What if I just want to call a method and ignore its return value?
In my case, I have a flow that ends in an outbound adapter that should just delete a temporary file. However File.delete() returns a boolean value, which I'm not interested in. Hence, an expression like payload.file.delete() throws a ConversionNotSupportedException, so now I have to wrap that expression into a ad-hoc service method call.
Is there a strong reason for requiring a void returning expression?
Affects: 4.1.6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the int:outbound-channel-adapter evaluates its SpEL expression and handles non-void results, using the reported ConversionNotSupportedException as the failure point. Reproduce the payload.file.delete() case and verify that a non-void method call can have its return value ignored without changing existing void-expression behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100