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.
This commit is contained in:
Thales Macedo Garitezi 2024-04-30 15:23:24 -03:00
parent 14ef0b1e51
commit 3942b371d7
1 changed files with 8 additions and 4 deletions

View File

@ -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,
[]