Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (19 sloc) 489 Bytes
module Baton
class PingConsumer < Baton::Consumer
def process_message(message)
case message["type"]
when "ping"
logger.info "received current ping for #{consumer_name}: #{message}"
notify(attributes)
else
raise Exception, "Unknown message type for #{consumer_name}: #{message}"
end
end
def routing_key
"#{server.environment}"
end
def attributes
{type: "pong"}.merge(server.attributes)
end
end
end