kkoderok commented on code in PR #13339:
URL: https://github.com/apache/pulsar/pull/13339#discussion_r841398032
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java:
##########
@@ -240,16 +253,23 @@ public void channelActive(ChannelHandlerContext ctx)
throws Exception {
ctx.close();
}
});
+ } else {
+ log.warn("Error during handshake", th);
+ ctx.close();
+ }
+ });
}
- protected ByteBuf newConnectCommand() throws Exception {
+ protected CompletableFuture<ByteBuf> newConnectCommand() throws Exception {
// mutual authentication is to auth between `remoteHostName` and this
client for this channel.
// each channel will have a mutual client/server pair, mutual client
evaluateChallenge with init data,
// and return authData to server.
authenticationDataProvider =
authentication.getAuthData(remoteHostName);
AuthData authData =
authenticationDataProvider.authenticate(AuthData.INIT_AUTH_DATA);
- return Commands.newConnect(authentication.getAuthMethodName(),
authData, this.protocolVersion,
- PulsarVersion.getVersion(), proxyToTargetBrokerAddress, null,
null, null);
+ return CompletableFuture.completedFuture(
Review Comment:
This method is overridden in the ProxyClientCnx class, which can use the
asynchronous operation of obtaining authorization data from the client, so this
method return a CompletableFuture
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]