@@ -302,6 +302,17 @@ def self.partitioner(str, partition_count, partitioner_name = "consistent_random
302302 attach_function :rd_kafka_event_DeleteTopics_result , [ :pointer ] , :pointer , blocking : true
303303 attach_function :rd_kafka_DeleteTopics_result_topics , [ :pointer , :pointer ] , :pointer , blocking : true
304304
305+ # Delete Group
306+
307+ RD_KAFKA_ADMIN_OP_DELETEGROUPS = 7 # rd_kafka_admin_op_t
308+ RD_KAFKA_EVENT_DELETEGROUPS_RESULT = 106 # rd_kafka_event_type_t
309+
310+ attach_function :rd_kafka_DeleteGroups , [ :pointer , :pointer , :size_t , :pointer , :pointer ] , :void , blocking : true
311+ attach_function :rd_kafka_DeleteGroup_new , [ :pointer ] , :pointer , blocking : true
312+ attach_function :rd_kafka_DeleteGroup_destroy , [ :pointer ] , :void , blocking : true
313+ attach_function :rd_kafka_event_DeleteGroups_result , [ :pointer ] , :pointer , blocking : true # rd_kafka_event_t* => rd_kafka_DeleteGroups_result_t*
314+ attach_function :rd_kafka_DeleteGroups_result_groups , [ :pointer , :pointer ] , :pointer , blocking : true # rd_kafka_DeleteGroups_result_t*, size_t* => rd_kafka_group_result_t**
315+
305316 # Background Queue and Callback
306317
307318 attach_function :rd_kafka_queue_get_background , [ :pointer ] , :pointer
@@ -408,5 +419,18 @@ def self.partitioner(str, partition_count, partitioner_name = "consistent_random
408419 attach_function :rd_kafka_event_error , [ :pointer ] , :int32
409420 attach_function :rd_kafka_event_error_string , [ :pointer ] , :pointer
410421 attach_function :rd_kafka_AclBinding_error , [ :pointer ] , :pointer
422+
423+
424+ # Extracting data from group results
425+ class NativeError < FFI ::Struct # rd_kafka_error_t
426+ layout :code , :int32 ,
427+ :errstr , :pointer ,
428+ :fatal , :uint8_t ,
429+ :retriable , :uint8_t ,
430+ :txn_requires_abort , :uint8_t
431+ end
432+
433+ attach_function :rd_kafka_group_result_error , [ :pointer ] , NativeError . by_ref # rd_kafka_group_result_t* => rd_kafka_error_t*
434+ attach_function :rd_kafka_group_result_name , [ :pointer ] , :pointer
411435 end
412436end
0 commit comments