blob: b5c14ef7294f020968517246fa0b5d5b74755c1a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
module Killjoy
module Mongo
class Consumer < Consumer
attr_reader :mongo_client
def initialize(writers, shard)
@mongo_client = Spank::IOC.resolve(:mongo_client)
super(writers, shard)
end
def work(message)
Killjoy.logger.info "[#{Thread.current.object_id}] got message: #{message}"
mongo_client[:log_lines].insert_one(message.to_hash)
message.ack!
end
end
end
end
|