Change summary
r2s-bwmsgsv2.rb | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
Detailed changes
@@ -28,9 +28,10 @@ $stdout.sync = true
puts "Redis queue to SGX HTTP request translator - for Bandwidth API V2 SGX\n"\
"==>> last commit of this version is " + `git rev-parse HEAD` + "\n"
-if ARGV.size != 4
- puts "Usage: r2s-bwmsgsv2.rb <redis_input_queue_key> "\
- "<redis_pending_queue_key> <sgx_hostname> <sgx_http_port>"
+if ARGV.size != 3
+ # note that <redis_queue_suffix> should match h2r-bwmsgsv2's $queue_name
+ puts "Usage: r2s-bwmsgsv2.rb <redis_queue_suffix> <sgx_hostname> "\
+ "<sgx_https_port>"
exit 0
end
@@ -47,7 +48,8 @@ puts "LOG %d.%09d: starting...\n\n" % [t.to_i, t.nsec]
redis = Redis.new(:driver => :hiredis)
while true
- timestamps_plus_json_blob = redis.brpoplpush(ARGV[0], ARGV[1])
+ timestamps_plus_json_blob = redis.brpoplpush('incoming_messages-' +
+ ARGV[0], 'pending_messages-' + ARGV[0])
# TODO: add timestamping here, and MUST include a ./tai call with it
# TODO: print less stuff in here
@@ -57,7 +59,7 @@ while true
# TODO: fix so sending timestamps_plus_json_blob to SGX, and via POST
response = Net::HTTP.get_response(
- URI("https://#{ARGV[2]}:#{ARGV[3]}/r2tst.php")
+ URI("https://#{ARGV[1]}:#{ARGV[2]}/r2tst.php")
)
puts "TODO - response.code = #{response.code} and body #{response.body}"