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



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

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)


30
31
32
33
34
35
36
# File 'lib/karafka/web/pro/ui/controllers/scheduled_messages/explorer_controller.rb', line 30

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)


18
19
20
21
22
23
24
# File 'lib/karafka/web/pro/ui/controllers/scheduled_messages/explorer_controller.rb', line 18

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

  render(attributes: response.attributes)
end