lolitra 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -56,7 +56,8 @@ module Lolitra
56
56
  end
57
57
 
58
58
  def handle(message)
59
- #puts "#{self.name} try to handle new message #{message.class.name}"
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
@@ -1,3 +1,3 @@
1
1
  module Lolitra
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Hugo Freire