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
Fix init WebSocketService with ClusterData #11234
Fix init WebSocketService with ClusterData #11234
Conversation
2. Refactor ProxyServiceStarter to be easier for test. 3. Add test case for ProxyServiceStarter.
/pulsarbot run-failure-checks |
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.
Great work!
The change LGTM, just left some minor comments about the tests
serviceStarter.getConfig().setBrokerServiceURL(pulsar.getBrokerServiceUrl()); | ||
serviceStarter.getConfig().setBrokerWebServiceURL(pulsar.getWebServiceAddress()); | ||
serviceStarter.getConfig().setServicePort(Optional.of(11000)); | ||
serviceStarter.getConfig().setWebSocketServiceEnabled(true); |
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.
Seems we are setting the configurations through the Java API, do we need to load the proxy.conf
file?
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.
Seems we are setting the configurations through the Java API, do we need to load the
proxy.conf
file?
ProxyServiceStarter load the config from command line "-c" and do this in the setup method.
But our test cases that start broker service listening on port 0, which would listen a port randomly.
We can't specified the brokerServerUrl in the proxy.conf then. for we dont know the port in actual. So I adjust the implemetation of ProxyServiceStarter, let it expose ProxyConfiguration, and we can set configs to runtime ones.
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.
I see. Thanks for the explanation
pulsar-proxy/src/test/java/org/apache/pulsar/proxy/server/ProxyServiceStarterTest.java
Outdated
Show resolved
Hide resolved
serviceStarter.getConfig().setBrokerServiceURL(pulsar.getBrokerServiceUrl()); | ||
serviceStarter.getConfig().setBrokerWebServiceURL(pulsar.getWebServiceAddress()); | ||
serviceStarter.getConfig().setServicePort(Optional.of(11000)); | ||
serviceStarter.getConfig().setWebSocketServiceEnabled(true); |
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.
I see. Thanks for the explanation
1. Fix init WebSocketService with ClusterData. 2. Refactor ProxyServiceStarter to be easier for test. 3. Add test case for ProxyServiceStarter. (cherry picked from commit 93e145b)
1. Fix init WebSocketService with ClusterData. 2. Refactor ProxyServiceStarter to be easier for test. 3. Add test case for ProxyServiceStarter. (cherry picked from commit 93e145b)
1. Fix init WebSocketService with ClusterData. 2. Refactor ProxyServiceStarter to be easier for test. 3. Add test case for ProxyServiceStarter.
Fixes #11233 .
Motivation