lib/bbk/app/dispatcher.rb
# Run all consumers and blocks on message processing
Run all consumers and blocks on message processing
Run all consumers and blocks on message processing
def run
        @pool = @pool_factory.call(@pool_size, 10)
        @stream_strategy = @stream_strategy_class.new(@pool, logger: logger)
        ActiveSupport::Notifications.instrument 'dispatcher.run', dispatcher: self
        @stream_strategy.run(consumers) do |msg|
          begin
            logger.tagged(msg.headers[:message_id]) do
              process msg
            end
          rescue StandardError => e
            logger.fatal "E[#{@stream_strategy_class}]: #{e}"
            logger.fatal "E[#{@stream_strategy_class}]: #{e.backtrace.join("\n")}"
          end
        end
      end
def run @pool = @pool_factory . call ( @pool_size , 10 ) @stream_strategy = @stream_strategy_class . new ( @pool , logger : logger ) ActiveSupport :: Notifications . instrument 'dispatcher.run' , dispatcher : self @stream_strategy . run ( consumers ) do | msg | begin logger . tagged ( msg . headers [ :message_id ] ) do process msg end rescue StandardError => e logger . fatal "E[#{@stream_strategy_class}]: #{e}" logger . fatal "E[#{@stream_strategy_class}]: #{e.backtrace.join("\n")}" end end end
Run all consumers and blocks on message processing
Run all consumers and blocks on message processing