Class: Karafka::Web::Ui::Models::Status::Checks::CommandsTopicPresence

Inherits:
Base
  • Object
show all
Defined in:
lib/karafka/web/ui/models/status/checks/commands_topic_presence.rb

Overview

Checks if the commands topic exists for Pro users.

The commands topic (karafka_consumers_commands) is used by Pro features like consumer commanding (pause, resume, trace, etc.). While it’s created by CreateTopics for all users (to allow smooth upgrades), it’s only actively used by Pro users.

For OSS users, this check always succeeds since they don’t use commanding. For Pro users, it warns if the topic is missing.

Instance Method Summary collapse

Methods inherited from Base

depends_on, halted_details, independent!, independent?, #initialize

Constructor Details

This class inherits a constructor from Karafka::Web::Ui::Models::Status::Checks::Base

Instance Method Details

#callStatus::Step

Executes the commands topic presence check.

Returns:

  • (Status::Step)

    success if not Pro or if topic exists, warning if Pro and topic is missing



25
26
27
28
29
30
31
32
33
# File 'lib/karafka/web/ui/models/status/checks/commands_topic_presence.rb', line 25

def call
  # OSS users don't need the commands topic
  return step(:success) unless ::Karafka.pro?

  topic_name = context.topics_consumers_commands
  present = topic_present?(topic_name)

  step(present ? :success : :warning, { topic_name: topic_name, present: present })
end