From 3942b371d7a3e6678a49f924bfe03c3c3367a9a2 Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Tue, 30 Apr 2024 15:23:24 -0300 Subject: [PATCH] feat(kafka consumer): allow custom group id Fixes https://emqx.atlassian.net/browse/EMQX-12273 Fixes EMQX-12273 When consuming messages in Kafka in Alibaba Cloud, the group needs to be configured in advance, and then the consumer can use the group to consume messages. Automatic group creation is generally not allowed online. --- .../test/emqx_bridge_v2_kafka_consumer_SUITE.erl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/emqx_bridge_kafka/test/emqx_bridge_v2_kafka_consumer_SUITE.erl b/apps/emqx_bridge_kafka/test/emqx_bridge_v2_kafka_consumer_SUITE.erl index 2f66b9c0e..1372bf71c 100644 --- a/apps/emqx_bridge_kafka/test/emqx_bridge_v2_kafka_consumer_SUITE.erl +++ b/apps/emqx_bridge_kafka/test/emqx_bridge_v2_kafka_consumer_SUITE.erl @@ -363,10 +363,14 @@ t_custom_group_id(Config) -> #{<<"parameters">> => #{<<"group_id">> => CustomGroupId}} ), [Endpoint] = emqx_bridge_kafka_impl:hosts(BootstrapHosts), - ?assertMatch( - {ok, [{_, CustomGroupId, _}]}, - brod:list_groups(Endpoint, _ConnOpts = #{}) - ), + ?retry(100, 10, begin + {ok, Groups} = brod:list_groups(Endpoint, _ConnOpts = #{}), + ?assertMatch( + [_], + [Group || Group = {_, Id, _} <- Groups, Id == CustomGroupId], + #{groups => Groups} + ) + end), ok end, []