Class: Karafka::Web::Ui::Lib::Admin

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/karafka/web/ui/lib/admin.rb

Overview

Note:

Not all commands need those optimizations, hence we alter only those that need that and we only expose those admin commands that are used in the Web-UI interface component.

Note:

We expose here only admin methods used in the Web UI interface. Processing uses the Karafka::Admin with the defaults

Wrapper around Karafka Admin that alters its behaviours or injects Web UI interface specific settings that optimize the responsiveness of the UI when operating on topics

Class Method Summary collapse

Class Method Details

.read_topic(name, partition, count, start_offset = -1,, settings = {}) ⇒ Array<Karafka::Messages::Message>

Allows us to read messages from the topic

Parameters:

  • name (String, Symbol)

    topic name

  • partition (Integer)

    partition

  • count (Integer)

    how many messages we want to get at most

  • start_offset (Integer, Time) (defaults to: -1,)

    offset from which we should start. If -1 is provided (default) we will start from the latest offset. If time is provided, the appropriate offset will be resolved. If negative beyond -1 is provided, we move backwards more.

  • settings (Hash) (defaults to: {})

    kafka extra settings (optional)

Returns:

  • (Array<Karafka::Messages::Message>)

    array with messages



33
34
35
36
37
38
39
40
41
42
# File 'lib/karafka/web/ui/lib/admin.rb', line 33

def read_topic(name, partition, count, start_offset = -1, settings = {})
  ::Karafka::Admin.read_topic(
    name,
    partition,
    count,
    start_offset,
    # Merge our Web UI specific settings
    config.merge(settings)
  )
end