lolitra 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/lolitra/handler_base.rb +4 -5
- data/lib/lolitra/version.rb +1 -1
- metadata +2 -2
data/lib/lolitra/handler_base.rb
CHANGED
@@ -56,7 +56,8 @@ module Lolitra
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def handle(message)
|
59
|
-
|
59
|
+
Lolitra::logger.debug("Message recived: #{message.class.message_key}")
|
60
|
+
Lolitra::logger.debug("#{message}")
|
60
61
|
begin
|
61
62
|
get_handler(message).handle(message)
|
62
63
|
rescue NoMethodError => e
|
@@ -165,6 +166,8 @@ module Lolitra
|
|
165
166
|
end
|
166
167
|
|
167
168
|
def self.publish(message_instance)
|
169
|
+
Lolitra::logger.debug("Message sent: #{message.class.message_key}")
|
170
|
+
Lolitra::logger.debug("#{message.marshall}")
|
168
171
|
instance.publish(message_instance)
|
169
172
|
end
|
170
173
|
|
@@ -255,8 +258,6 @@ module Lolitra
|
|
255
258
|
end
|
256
259
|
|
257
260
|
def publish(message)
|
258
|
-
Lolitra::logger.debug("Message sent: #{message.class.message_key}")
|
259
|
-
Lolitra::logger.debug("#{message.marshall}")
|
260
261
|
self.exchange.publish(message.marshall, :routing_key => message.class.message_key, :timestamp => Time.now.to_i)
|
261
262
|
end
|
262
263
|
|
@@ -265,8 +266,6 @@ module Lolitra
|
|
265
266
|
EM.next_tick do
|
266
267
|
channel = AMQP::Channel.new(self.connection)
|
267
268
|
channel.prefetch(1).queue(queue_name, options).bind(self.exchange, :routing_key => message_class.message_key).subscribe do |info, payload|
|
268
|
-
Lolitra::logger.debug("Message recived: #{info.routing_key}")
|
269
|
-
Lolitra::logger.debug("#{payload}")
|
270
269
|
message_class_tmp = handler_class.handlers[info.routing_key][0]
|
271
270
|
handler_class.handle(message_class_tmp.unmarshall(payload))
|
272
271
|
end
|
data/lib/lolitra/version.rb
CHANGED