diff --git a/r2s-bwmsgsv2.rb b/r2s-bwmsgsv2.rb index 1c8d0a0dd2fbcadc98eaf7828fb96ce9675aad4a..2a230b2f9139ccb6085f54ca20cf1d5fa55f8761 100755 --- a/r2s-bwmsgsv2.rb +++ b/r2s-bwmsgsv2.rb @@ -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 "\ - " " +if ARGV.size != 3 + # note that should match h2r-bwmsgsv2's $queue_name + puts "Usage: r2s-bwmsgsv2.rb "\ + "" 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}"