Repository navigation
Conversation
Reuse the shared RoutingClient instead of building a second one, drop the Mono bean with initMethod = "block", and stop making the cleaner depend on it. Fail with a clear message if there is no default-tcp router group.
ZPascal
force-pushed
the
router-group-ports-cleanup
branch
from
October 31, 2026 09:36
a2c182e to
7e7bedb
Compare
Resolve the default-tcp group with flatMapIterable and blockFirst instead of blocking on the whole response, which also avoids an NPE when the response is empty.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1383, picking up Daniel's review comment: #1383 (comment)
The bean that sets the reservable port range on the
default-tcprouter group was a bit convoluted. This cleans it up:RoutingClientbean now instead of building a second client with its own token provider.MonowithinitMethod = "block". It's aSmartInitializingSingletonthat runs once the context is up.cloudFoundryCleanerdoesn't depend on it anymore. The initial cleanup now always runs, even when TCP routing isn't available.default-tcpgroup, it fails with a message that points toSKIP_TCP_ROUTING_TESTS=true. It is used only to log a warning.@ConditionalOnExpressiononSKIP_TCP_ROUTING_TESTS.Why is it implemented as a bean?
I didn't use an
ApplicationRunnerlike in the suggestion because the integration tests use@SpringJUnitConfig, not Spring Boot's application startup, so runners never get called.SmartInitializingSingletongives the same timing.Moving the CF cleaner to the same pattern is left for later, as discussed.
It compiles, but I haven't run the integration tests against a real Cloud Foundry yet.
Connected issue: #1394