Skip to content

Provide properties to block threads by default (again)  #8704

@swiss-chris

Description

@swiss-chris

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).

  • spring.integration.thread-blocking-timeout=-1s
  • spring.integration.thread-blocking-timeout-enabled=false

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.

  • Either we look for every gateway() and every scatterGather() 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.
  • Or we take the time to analyse each gateway() and each scatterGather() 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.

.scatterGather(
  scatterer -> scatterer
    .recipientFlow(flow -> flow
      .gateway(flow -> flow
        .gateway(subflow, 
          spec -> spec.replyTimeout(-1L)),
        spec -> spec.replyTimeout(-1L))
  gatherer -> gatherer.doSomething(),
  spec -> spec.gatherTimeout(-1L)
)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions