Skip to content
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

Replace usage of recently removed SocketUtils #825

Closed
onobc opened this issue Mar 13, 2022 · 3 comments
Closed

Replace usage of recently removed SocketUtils #825

onobc opened this issue Mar 13, 2022 · 3 comments
Assignees

Comments

@onobc
Copy link
Contributor

onobc commented Mar 13, 2022

Main fails to compile as SocketUtils has been deprecated->removed from the Spring Framework.

Temporary Workaround:

I took a very slimmed down version of org.springframework.util.SocketUtils and dropped it under spring-cloud-function-core. It only exposes the findAvailableTcpPort as that is all that the tests are using.

Suggested Alternative

Instead user port 0 and rely on the OS to assign a port to the server and then query the server for the port it is running on.

Options

Option 1: Replace all usages of SocketUtils w/ the suggested alternative.

Option 2: Create a TestSocketUtils and put in shared test lib

I have started a team discussion and will let that drive the chosen option. In the meantime I will replace as many usages as possible.

cc: @olegz

@onobc onobc self-assigned this Mar 13, 2022
@onobc
Copy link
Contributor Author

onobc commented Mar 13, 2022

About 80% through the changes w/o the need for SocketUtils so far. I do see a couple of places I may need it though.

onobc added a commit to onobc/spring-cloud-function that referenced this issue Mar 13, 2022
@chrylis
Copy link

chrylis commented Mar 18, 2022

Was the referenced possible TestSocketUtils ever created? I am relying on SocketUtils because the DynamoDB Local server does not support starting on a random port.

@onobc
Copy link
Contributor Author

onobc commented Mar 18, 2022

Hi @chrylis - it exists in the associated PR. However, the intention is to remove it ASAP in favor of a more centrally available one (such as the one in spring-cloud-test-support. Also, the one in the PR will not be published or usable outside of the SCF repo.

@olegz olegz closed this as completed in 1fb5af2 Mar 23, 2022
olegz pushed a commit that referenced this issue Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants