Sha256: 59b1357a426cde2e489d319f6cf0505974bd767d30873778eb37b3812ff135a2

Contents?: true

Size: 830 Bytes

Versions: 1

Compression:

Stored size: 830 Bytes

Contents

ENV['RACK_ENV'] ||= 'development'
ENV['KARAFKA_ENV'] ||= ENV['RACK_ENV']

Bundler.require(:default, ENV['KARAFKA_ENV'])

Karafka::Loader.new.load(Karafka::App.root)

# App class
class App < Karafka::App
  setup do |config|
    config.kafka.seed_brokers = %w( 127.0.0.1:9092 )
    config.client_id = 'example_app'
    config.redis = {
      url: 'redis://localhost:6379'
    }
    config.inline_processing = Karafka.env.development?
    config.batch_consuming = true
  end

  consumer_groups.draw do
    # topic :example do
    #   controller ExampleController
    #   interchanger CustomInterchanger
    # end

    # consumer_group :bigger_group do
    #   topic :test do
    #     controller TestController
    #   end
    #
    #   topic :test2 do
    #     controller Test2Controller
    #   end
    # end
  end
end

App.boot!

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
karafka-0.6.0.rc1 lib/karafka/templates/app.rb.example