Skip to content

How to gracefully shutdown consumer group? #434

@lessless

Description

@lessless

Hi,

I'm looking for a way to gracefully shutdown a consumer group.

Let's say there is a setting that can be flipped to turn off consumption and that setting can be checked in handle_message_set.

 def handle_message_set(message_set, state) do
    do_some_job(message_set)
    if Settings.stop?() do
      commit_and_shutdown()
    else 
      commit()
    end
  end

The absolute must here is to no receive any new messages even if the cluster undergoes a rebalance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions