-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Remove SocketUtils usage #3728
Remove SocketUtils usage #3728
Conversation
* Remove usage of non-stable `org.springframework.util.SocketUtils` * Replace it with `0` for those tests where it is possible to select OS port * Remove the mentioning of the `SocketUtils` from the `testing.adoc` * Use `TransportConstants.DEFAULT_STOMP_PORT` for `StompServerIntegrationTests`. We may disable this test in the future for CI if it is not going to be stable * Introduce `Supplier<String> connectUrl` variants for `ZeroMqMessageHandler` to let it defer connection evaluation until subscription to the socket `Mono` in the `ZeroMqMessageHandler`. * Move connection logic in the `ZeroMqMessageHandler` to `Lifecycle.start()` Related to spring-projects/spring-framework#28054 **Cherry-pick to `5.4.x`**
I'd appreciate if you test it locally on your OS. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, UDP doesn't work on my new MacBook and I haven't had time to figure out why, but our friends at GH Actions have verified it.
I don't see how we can cherry-pick this (except just the tests) because it is a documented class - it needs to be deprecated in 5.5.x.
ConfigurationImpl configuration = | ||
new ConfigurationImpl() | ||
.setName("embedded-server") | ||
.setPersistenceEnabled(false) | ||
.setSecurityEnabled(false) | ||
.setJMXManagementEnabled(false) | ||
.setJournalDatasync(false) | ||
.addAcceptorConfiguration("stomp", "tcp://127.0.0.1:" + port) | ||
.addAcceptorConfiguration("stomp", "tcp://127.0.0.1:" + TransportConstants.DEFAULT_STOMP_PORT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to use a flaky SocketUtils
rather than hard coding to a single port if the component doesn't support 0
.
I'd prefer disabling (per your comment), if you want to remove it completely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no such a class in SF 6.0 any more.
So, I wouldn't mind to watch this until it fails with the port conflict 😄
There is nothing to deprecate for us: we use already that one from Spring Framework. |
Stomp needs back-porting for 5.5.x; Artemis is not present there. |
Thanks. On it. |
... and back-ported to |
org.springframework.util.SocketUtils
0
for those tests where it is possible to select OS portSocketUtils
from thetesting.adoc
TransportConstants.DEFAULT_STOMP_PORT
forStompServerIntegrationTests
.We may disable this test in the future for CI if it is not going to be stable
Supplier<String> connectUrl
variants forZeroMqMessageHandler
to let it defer connection evaluation until subscription to the socket
Mono
in the
ZeroMqMessageHandler
.ZeroMqMessageHandler
toLifecycle.start()
Related to spring-projects/spring-framework#28054
Cherry-pick to
5.5.x