Skip to content

Commit

Permalink
[fix] Initialize UrlServiceProvider before trying to use transaction …
Browse files Browse the repository at this point in the history
…coordinator (#23914)
  • Loading branch information
merlimat authored Jan 31, 2025
1 parent 12b0579 commit cdab2d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ public PulsarClient build() throws PulsarClientException {
if (conf.getAuthentication() == null || conf.getAuthentication() == AuthenticationDisabled.INSTANCE) {
setAuthenticationFromPropsIfAvailable(conf);
}
PulsarClient client = new PulsarClientImpl(conf);
if (conf.getServiceUrlProvider() != null) {
conf.getServiceUrlProvider().initialize(client);
}
return client;
return new PulsarClientImpl(conf);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ private PulsarClientImpl(ClientConfigurationData conf, EventLoopGroup eventLoopG
this.timer = timer;
}

if (conf.getServiceUrlProvider() != null) {
conf.getServiceUrlProvider().initialize(this);
}

if (conf.isEnableTransaction()) {
tcClient = new TransactionCoordinatorClientImpl(this);
try {
Expand Down

0 comments on commit cdab2d6

Please sign in to comment.