-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Provide properties to block threads by default (again) #8704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I thought about that when answered your SO question: https://stackoverflow.com/questions/76876192/spring-integration-6-1-breaking-change-threads-no-longer-block-indefinitely. I think the name of the property will be: In Spring Boot it might be like |
Thanks Artem. PS: We're using Spring Integration for some heavy lifting, reading over a hundred thousands rows from DB tables, transforming them, and then persisting them to other DB tables. These operations often take longer than 30 seconds. In other places we're making parallel calls to external systems, transforming the results and persisting. That too can take more than 30 seconds. Not sure how we could do this differently. |
In asynchronous manner: fire-n-forget. |
Fixes spring-projects#8704 The default timeout for requests and replies in the integration endpoints is 30 seconds to avoid indefinite blocking in threads. Sometime those 30 seconds is not enough. * Introduce a `spring.integration.endpoints.defaultTimeout` global property to allow overriding all the timeouts to desired value. The negative number indicates an indefinite waiting time: similar to what was there before introducing 30 seconds by default
* GH-8704: Add global property for `defaultTimeout` Fixes #8704 The default timeout for requests and replies in the integration endpoints is 30 seconds to avoid indefinite blocking in threads. Sometime those 30 seconds is not enough. * Introduce a `spring.integration.endpoints.defaultTimeout` global property to allow overriding all the timeouts to desired value. The negative number indicates an indefinite waiting time: similar to what was there before introducing 30 seconds by default * Fix language in docs Co-authored-by: Gary Russell <[email protected]> --------- Co-authored-by: Gary Russell <[email protected]>
I tried but didn't succeed in getting this to work. I opened a separate issue here: spring-projects/spring-integration-samples#361 |
Also, it seems like the java dsl sample coffee app suffers from a similar fate as our applications: spring-projects/spring-integration-samples#361 |
Unfortunately that looks like we have missed to expose that property via Spring Boot configuration: spring-projects/spring-boot#41477. I will think about a workaround for you over weekend... |
I think that a bean post-processor for the
|
I thought about that as well, Andy.
😄 Due to the way it is implemented now in Spring Boot, we don't have any other choices and unfortunately with that we cannot read props from the file. Well, we can do like manual The proper fix we will discuss in respective Spring Boot issue. |
IIRC, more recent versions of Framework (maybe only 6.2?) will reject |
Expected Behavior
Users of Spring Integration can configure the new timeout defaults (for details, see below) globally instead of sprinkling new boilerplate timeout code throughout the application.
Here's an example of how such a configuration could look in application.properties (or yaml).
Current Behavior
According to https://github.com/spring-projects/spring-integration/wiki/Spring-Integration-6.0-to-6.1-Migration-Guide#do-not-block-by-default, the default timeout for various SI operations has been changed from disabled to 30s. This breaks multiple SI projects in our team/company.
Context
We have several Spring Integration projects which are negatively affected by this change. We currently have 2 possibilities to fix our code.
gateway()
and everyscatterGather()
call and pre-emptively disable the timeout in all these places. Today we looked at an application with 28 gateway() calls. Disadvantage: Lots of boilerplate code -> not Spring-like.gateway()
and eachscatterGather()
call and only disable the timeout where we have decided the call could take more than 30s. Disadvantage: requires more time to do.Here's an example of the kind of code I'm talking about.
The text was updated successfully, but these errors were encountered: