lib/eventbus/message.rb in eventbus-0.29 vs lib/eventbus/message.rb in eventbus-0.30
- old
+ new
@@ -1,7 +1,7 @@
require 'rubygems'
-require 'yaml'
+require 'json'
require 'uuid'
require 'eventbus/common_init'
require 'eventbus/queue'
module EventBus
@@ -93,11 +93,11 @@
if queue_name.nil?
queue_name = "dispatcher"
opts[:system_queue] = true
end
- opts[:queue_name] = Queue.calc_name(queue_name, application_id, ENV['PROD_LEVEL'], opts)
+ opts[:queue_name] = Queue.calc_name(queue_name, application_id, ENV['EVENTBUS_PROD_LEVEL'], opts)
puts "Sending message to: #{opts[:queue_name]}"
set_special(:HEADER, :sender, $0)
send_raw self.dump, opts
@@ -113,14 +113,14 @@
self.is_error = true
self.status = exception.class.name
end
def dump
- YAML::dump(@data)
+ JSON.generate(@data, :indent => ' ', :space => ' ', :object_nl => "\n", :array_nl => "\n", :max_nesting => 50)
end
- def load(yaml)
- @data = YAML::load(yaml)
+ def load(raw)
+ @data = JSON::parse(raw)
end
def application_id
return get_special(:HEADER, :application_id)
end