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

[fix][broker] PulsarStandalone started with error if --stream-storage-port is not 4181 #22993

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ public void runStreamStorage(CompositeConfiguration conf) throws Exception {
// create a default namespace
try (StorageAdminClient admin = StorageClientBuilder.newBuilder()
.withSettings(StorageClientSettings.newBuilder()
.serviceUri("bk://localhost:4181")
.serviceUri("bk://localhost:" + streamStoragePort)
.backoffPolicy(Backoff.Jitter.of(
Type.EXPONENTIAL,
1000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;

import org.apache.bookkeeper.conf.ServerConfiguration;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
Expand Down Expand Up @@ -54,4 +56,18 @@ public void testStartStop() throws Exception {
assertFalse(ensemble.getZkClient().getState().isConnected());
assertFalse(ensemble.getBookies()[0].isRunning());
}

@Test(timeOut = 10_000)
public void testStartWithSpecifiedStreamStoragePort() throws Exception {
LocalBookkeeperEnsemble ensemble = null;
try {
ensemble =
new LocalBookkeeperEnsemble(1, 0, 0, 4182, null, null, true, null);
ensemble.startStandalone(new ServerConfiguration(), true);
} finally {
if (ensemble != null) {
ensemble.stop();
}
}
}
}
Loading