Skip to content

Commit

Permalink
[Java Client] Avoid IllegalStateException in ClientCnx debug logs (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljmarshall authored Nov 22, 2021
1 parent 793a8b9 commit 32b697d
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,9 @@ protected void handleProducerSuccess(CommandProducerSuccess success) {
@Override
protected void handleLookupResponse(CommandLookupTopicResponse lookupResult) {
if (log.isDebugEnabled()) {
log.debug("Received Broker lookup response: {}", lookupResult.getResponse());
CommandLookupTopicResponse.LookupType response =
lookupResult.hasResponse() ? lookupResult.getResponse() : null;
log.debug("Received Broker lookup response: {} {}", lookupResult.getRequestId(), response);
}

long requestId = lookupResult.getRequestId();
Expand Down Expand Up @@ -577,7 +579,11 @@ protected void handleLookupResponse(CommandLookupTopicResponse lookupResult) {
@Override
protected void handlePartitionResponse(CommandPartitionedTopicMetadataResponse lookupResult) {
if (log.isDebugEnabled()) {
log.debug("Received Broker Partition response: {}", lookupResult.getPartitions());
CommandPartitionedTopicMetadataResponse.LookupType response =
lookupResult.hasResponse() ? lookupResult.getResponse() : null;
int partitions = lookupResult.hasPartitions() ? lookupResult.getPartitions() : -1;
log.debug("Received Broker Partition response: {} {} {}", lookupResult.getRequestId(), response,
partitions);
}

long requestId = lookupResult.getRequestId();
Expand Down

0 comments on commit 32b697d

Please sign in to comment.