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

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

Overview

Note:

This check does NOT verify if the group is active because that may depend on configuration details. It only checks that the routing is aware of the deserializer and other Web UI requirements.

Checks if karafka-web is enabled in the karafka.rb routing.

This is the first check in the chain and verifies that the consumer group for the Web UI is properly injected into the routing. Without this, the Web UI cannot function.

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 enabled check.

Looks for the Web UI consumer group in the Karafka routing.

Returns:

  • (Status::Step)

    success if the group is found, failure otherwise



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

def call
  enabled = ::Karafka::App.routes.map(&:name).include?(
    ::Karafka::Web.config.group_id
  )

  step(enabled ? :success : :failure)
end