Sha256: 9dfb8c19d79da4bc7c93301b9fb92c9b40da1d992ccd35171a682b270f7f23d8

Contents?: true

Size: 645 Bytes

Versions: 2

Compression:

Stored size: 645 Bytes

Contents

class WalletEventsConsumer
  include Asynk::Consumer

  set_consume 'gm_backend.kroter_wallet.*'
  set_queue 'gm_backend.kroter_wallet_queue', durable: true, ack: true
  set_subscribe_arguments manual_ack: true
  set_concurrency 2
  set_sync true

  def process(msg)
    # logger.info "Msg received: #{msg}"
    # raise 'Inpropriate User' if msg[:name] == 'Insaf'

    # user = User.create(name: msg['name'], surname: msg['surname'])
    # logger.info ['count: ', User.count].join(' ')
    ack!
    Asynk::Response.new(status: :ok)
  rescue Exception => e
    reject!
    Asynk::Response.new(status: :failed, error_message: e.message )
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
asynk-0.0.2 myapp/app/consumers/wallet_events_consumer.rb
asynk-0.0.1 myapp/app/consumers/wallet_events_consumer.rb