Skip to content

Commit

Permalink
Adding int identifier for transactional ID (#4856)
Browse files Browse the repository at this point in the history
Co-authored-by: John "Preston" Mille <john@ews-network.net>
  • Loading branch information
pranavrth and JohnPreston authored Oct 9, 2024
1 parent 0cd23c6 commit 54480ef
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

librdkafka v2.6.0 is a feature release:

* [KIP-460](https://cwiki.apache.org/confluence/display/KAFKA/KIP-460%3A+Admin+Leader+Election+RPC) Admin Leader Election RPC (#4845)
* [KIP-714] Complete consumer metrics support (#4808).
* [KIP-714] Produce latency average and maximum metrics support for parity with Java client (#4847).
* [KIP-848] ListConsumerGroups Admin API now has an optional filter to return only groups
of given types.
* Added Transactional id resource type for ACL operations (@JohnPreston, #4856).
* Fix for permanent fetch errors when using a newer Fetch RPC version with an older
inter broker protocol (#4806).
* [KIP-460](https://cwiki.apache.org/confluence/display/KAFKA/KIP-460%3A+Admin+Leader+Election+RPC) Admin Leader Election RPC (#4845)



## Fixes
Expand Down
13 changes: 7 additions & 6 deletions src/rdkafka.h
Original file line number Diff line number Diff line change
Expand Up @@ -7820,12 +7820,13 @@ rd_kafka_ConfigEntry_synonyms(const rd_kafka_ConfigEntry_t *entry,
* @brief Apache Kafka resource types
*/
typedef enum rd_kafka_ResourceType_t {
RD_KAFKA_RESOURCE_UNKNOWN = 0, /**< Unknown */
RD_KAFKA_RESOURCE_ANY = 1, /**< Any (used for lookups) */
RD_KAFKA_RESOURCE_TOPIC = 2, /**< Topic */
RD_KAFKA_RESOURCE_GROUP = 3, /**< Group */
RD_KAFKA_RESOURCE_BROKER = 4, /**< Broker */
RD_KAFKA_RESOURCE__CNT, /**< Number of resource types defined */
RD_KAFKA_RESOURCE_UNKNOWN = 0, /**< Unknown */
RD_KAFKA_RESOURCE_ANY = 1, /**< Any (used for lookups) */
RD_KAFKA_RESOURCE_TOPIC = 2, /**< Topic */
RD_KAFKA_RESOURCE_GROUP = 3, /**< Group */
RD_KAFKA_RESOURCE_BROKER = 4, /**< Broker */
RD_KAFKA_RESOURCE_TRANSACTIONAL_ID = 5, /**< Transactional ID */
RD_KAFKA_RESOURCE__CNT, /**< Number of resource types defined */
} rd_kafka_ResourceType_t;

/**
Expand Down
5 changes: 2 additions & 3 deletions src/rdkafka_admin.c
Original file line number Diff line number Diff line change
Expand Up @@ -2901,9 +2901,8 @@ const char *rd_kafka_ResourcePatternType_name(
}

const char *rd_kafka_ResourceType_name(rd_kafka_ResourceType_t restype) {
static const char *names[] = {
"UNKNOWN", "ANY", "TOPIC", "GROUP", "BROKER",
};
static const char *names[] = {"UNKNOWN", "ANY", "TOPIC",
"GROUP", "BROKER", "TRANSACTIONAL_ID"};

if ((unsigned int)restype >= (unsigned int)RD_KAFKA_RESOURCE__CNT)
return "UNSUPPORTED";
Expand Down
6 changes: 3 additions & 3 deletions tests/0080-admin_ut.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,8 +1184,8 @@ static void do_test_AclBinding() {
char errstr[512];
rd_kafka_AclBinding_t *new_acl;

rd_bool_t valid_resource_types[] = {rd_false, rd_false, rd_true,
rd_true, rd_true, rd_false};
rd_bool_t valid_resource_types[] = {
rd_false, rd_false, rd_true, rd_true, rd_true, rd_true, rd_false};
rd_bool_t valid_resource_pattern_types[] = {
rd_false, rd_false, rd_false, rd_true, rd_true, rd_false};
rd_bool_t valid_acl_operation[] = {
Expand Down Expand Up @@ -1316,7 +1316,7 @@ static void do_test_AclBindingFilter() {
char errstr[512];
rd_kafka_AclBindingFilter_t *new_acl_filter;

rd_bool_t valid_resource_types[] = {rd_false, rd_true, rd_true,
rd_bool_t valid_resource_types[] = {rd_false, rd_true, rd_true, rd_true,
rd_true, rd_true, rd_false};
rd_bool_t valid_resource_pattern_types[] = {
rd_false, rd_true, rd_true, rd_true, rd_true, rd_false};
Expand Down

0 comments on commit 54480ef

Please sign in to comment.