spring-projects / spring-framework

Spring Framework
https://spring.io/projects/spring-framework
Apache License 2.0
56.75k stars 38.16k forks source link

Remove ServerResponse.AsyncBuilder interface #33736

Closed bclozel closed 1 month ago

bclozel commented 1 month ago

In #32710, we introduced a new contract for streaming responses with MVC functional endpoints. While doing, so we introduced a new interface ServerResponse.AsyncBuilder to gather async concerns under the same shared interface (error/complete/timeout).

This avoids duplication, but this also introduces a binary incompatible change that is problematic in case projects want to maintain compatibility with two generations of Spring Framework. While we don't usually guarantee binary compatibility between minor versions, here Spring for GraphQL is relying on that and will not ship a new minor version with the next release train.

Here is an example of a build failure.

We should undo this change and re-introduce it with the next major Spring Framework version.

spencergibb commented 1 month ago

I think spring cloud gateway was impacted https://github.com/spring-cloud/spring-cloud-gateway/commit/1abf9b873c66a79370a509d9d44904acf7c97dd3

bclozel commented 1 month ago

We're not going to remove the new stream method, but rather move back the following methods back to the original ServerResponse.SseBuilder interface: