Class: Karafka::Web::Pro::Ui::Controllers::ScheduledMessages::ExplorerController

Inherits:
BaseController show all
Defined in:
lib/karafka/web/pro/ui/controllers/scheduled_messages/explorer_controller.rb

Overview

Allows for exploration of dispatch messages in a less generic form that via the explorer as different details are present

Constant Summary

Constants inherited from Ui::Controllers::BaseController

Ui::Controllers::BaseController::Models

Instance Attribute Summary

Attributes inherited from Ui::Controllers::BaseController

#params, #session

Instance Method Summary collapse

Methods inherited from Ui::Controllers::BaseController

#cache, #initialize

Methods included from Ui::Controllers::Requests::Hookable

included, #run_after_hooks, #run_before_hooks

Constructor Details

This class inherits a constructor from Karafka::Web::Ui::Controllers::BaseController

Instance Method Details

#closest(topic_id, partition_id, time) ⇒ Object

Finds the closest offset matching the requested time and redirects to this location Note, that it redirects to closest but always younger.

Parameters:

  • topic_id (String)
  • partition_id (Integer)
  • time (Time)

    time of the message



69
70
71
72
73
74
75
# File 'lib/karafka/web/pro/ui/controllers/scheduled_messages/explorer_controller.rb', line 69

def closest(topic_id, partition_id, time)
  response = Controllers::Explorer::ExplorerController
    .new(@params, @session)
    .closest(topic_id, partition_id, time)

  redirect("scheduled_messages/#{response.path}")
end

#partition(topic_id, partition_id) ⇒ Object

Shows messages available in a given partition

Parameters:

  • topic_id (String)
  • partition_id (Integer)


55
56
57
58
59
60
61
# File 'lib/karafka/web/pro/ui/controllers/scheduled_messages/explorer_controller.rb', line 55

def partition(topic_id, partition_id)
  response = Controllers::Explorer::ExplorerController
    .new(@params, @session)
    .partition(topic_id, partition_id)

  render(attributes: response.attributes)
end

#topic(topic_id) ⇒ Object

Displays aggregated messages from (potentially) all partitions of a topic

Parameters:

  • topic_id (String)


43
44
45
46
47
48
49
# File 'lib/karafka/web/pro/ui/controllers/scheduled_messages/explorer_controller.rb', line 43

def topic(topic_id)
  response = Controllers::Explorer::ExplorerController
    .new(@params, @session)
    .topic(topic_id)

  render(attributes: response.attributes)
end