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 some OAuth related issues #233

Merged
merged 1 commit into from
Jul 3, 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
3 changes: 2 additions & 1 deletion include/kafka/ClientCommon.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <chrono>
#include <kafka/Project.h>

#include <kafka/Error.h>
Expand Down Expand Up @@ -32,7 +33,7 @@ namespace KAFKA_API { namespace clients {
using KeyValuePairs = std::map<std::string, std::string>;

std::string value;
std::chrono::microseconds mdLifetime{};
std::chrono::milliseconds mdLifetime{};
std::string mdPrincipalName;
KeyValuePairs extensions;
};
Expand Down
5 changes: 3 additions & 2 deletions include/kafka/KafkaClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ KafkaClient::KafkaClient(ClientType clientType,
}
else
{
KAFKA_API_DO_LOG(Log::Level::Err, "failed to be initialized with property[%s:%s], result[%d]", k.c_str(), v->c_str(), result);
KAFKA_API_DO_LOG(Log::Level::Err, "failed to be initialized with property[%s:%s], result[%d]: %s", k.c_str(), v->c_str(), result, errInfo.c_str());
}
}

Expand Down Expand Up @@ -570,11 +570,12 @@ KafkaClient::oauthbearerTokenRefreshCallback(rd_kafka_t* rk, const char* oauthbe

try
{
oauthbearerToken = kafkaClient(rk).onOauthbearerTokenRefresh(oauthbearerConfig);
oauthbearerToken = kafkaClient(rk).onOauthbearerTokenRefresh(oauthbearerConfig != nullptr ? oauthbearerConfig : "");
}
catch (const std::exception& e)
{
rd_kafka_oauthbearer_set_token_failure(rk, e.what());
return;
}

LogBuffer<LOG_BUFFER_SIZE> errInfo;
Expand Down
Loading