Class: Karafka::App

Inherits:
Object
  • Object
show all
Extended by:
Setup::Dsl
Defined in:
lib/karafka/app.rb

Overview

App class

Class Method Summary collapse

Methods included from Setup::Dsl

config, setup

Class Method Details

.boot!Object

Sets up all the internal components and bootstrap whole app We need to know details about consumers in order to setup components, that’s why we don’t setup them after std setup is done

Raises:



14
15
16
17
18
19
# File 'lib/karafka/app.rb', line 14

def boot!
  initialize!
  Setup::Config.validate!
  Setup::Config.setup_components
  initialized!
end

.consumer_groupsKarafka::Routing::Builder

Returns consumers builder instance.

Returns:



22
23
24
# File 'lib/karafka/app.rb', line 22

def consumer_groups
  config.internal.routing_builder
end

.reloadObject

Triggers reload of all cached Karafka app components, so we can use in-process in-development hot code reloading without Karafka process restart



28
29
30
31
32
# File 'lib/karafka/app.rb', line 28

def reload
  Karafka::Persistence::Consumers.clear
  Karafka::Persistence::Topics.clear
  config.internal.routing_builder.reload
end