http_streaming_client 0.8.8 → 0.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -0
- data/lib/http_streaming_client/client.rb +2 -2
- data/lib/http_streaming_client/version.rb +1 -1
- data/spec/adobe_spec.rb +1 -73
- data/tools/adobe_firehose.rb +1 -1
- data/tools/adobe_firehose_performance_test.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb3fd5a42dd28932b96ea17e46cef4d80b04071c
|
4
|
+
data.tar.gz: 75409d8168f3c569a02b7cdd864cad837f46b77f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8570c1961c6583d85a59a20be4ccc0d7478d9cae728d168df956fed316b94505c8bdc43561c125e7fd60a63d60facb578e374f144f126f395e79bed34358cdcc
|
7
|
+
data.tar.gz: 4621c9db54fd9777ae4e9f07449700f522865fe8c668b33fc888f1efec5f43d4d13209748fd247471f4eefc620492b2b66d7b728f5da34e9d56bb93ef3fad5cf
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
http_streaming_client 0.8.9 (1.26.2014)
|
2
|
+
========================================
|
3
|
+
* A few minor logging warn/debug changes
|
4
|
+
|
1
5
|
http_streaming_client 0.8.8 (1.7.2014)
|
2
6
|
========================================
|
3
7
|
* Fixed Issue #1, memory leak due to accumulated messages within the buffer pipeline
|
@@ -194,7 +194,7 @@ module HttpStreamingClient
|
|
194
194
|
if response_head[:code] == 301 then
|
195
195
|
location = response_head[:headers]["Location"]
|
196
196
|
raise InvalidRedirect, "Unable to find Location header for HTTP 301 response" if location.nil?
|
197
|
-
logger.
|
197
|
+
logger.warn "Received HTTP 301 redirect to #{location}, following..."
|
198
198
|
socket.close if !socket.nil? and !socket.closed?
|
199
199
|
opts.delete(:socket)
|
200
200
|
return request(method, location, opts, &block)
|
@@ -351,7 +351,7 @@ module HttpStreamingClient
|
|
351
351
|
end
|
352
352
|
rescue => e
|
353
353
|
return if @interrupted
|
354
|
-
logger.
|
354
|
+
logger.error "Error Detected: #{e}" unless e.instance_of? ReconnectRequest
|
355
355
|
decoder.close if !decoder.nil?
|
356
356
|
socket.close if !socket.nil? and !socket.closed?
|
357
357
|
opts.delete(:socket)
|
data/spec/adobe_spec.rb
CHANGED
@@ -9,78 +9,6 @@ include HttpStreamingClient::Credentials::Adobe
|
|
9
9
|
|
10
10
|
describe HttpStreamingClient do
|
11
11
|
|
12
|
-
describe "adobe firehose streaming get test, no compression" do
|
13
|
-
|
14
|
-
url = TOKENAPIHOST
|
15
|
-
authorization = HttpStreamingClient::Oauth::Adobe.generate_authorization(url, USERNAME, PASSWORD, CLIENTID, CLIENTSECRET)
|
16
|
-
|
17
|
-
subject { authorization }
|
18
|
-
it { should_not be_nil}
|
19
|
-
it { should be_instance_of(String) }
|
20
|
-
|
21
|
-
line_count = 0
|
22
|
-
|
23
|
-
it "should successfully retrieve JSON records from the firehose" do
|
24
|
-
expect {
|
25
|
-
client = HttpStreamingClient::Client.new(compression: false)
|
26
|
-
begin
|
27
|
-
status = Timeout::timeout(TIMEOUT_SEC) {
|
28
|
-
response = client.get(STREAMURL, {:headers => {'Authorization' => "Bearer #{authorization}" }}) { |line|
|
29
|
-
|
30
|
-
if line.nil? then
|
31
|
-
logger.debug "error:nil line received"
|
32
|
-
next
|
33
|
-
end
|
34
|
-
|
35
|
-
if line.size == 0 then
|
36
|
-
logger.debug "error:zero length line received"
|
37
|
-
next
|
38
|
-
end
|
39
|
-
|
40
|
-
line_count = line_count + 1
|
41
|
-
|
42
|
-
if line.eql? "\r\n" then
|
43
|
-
logger.debug "Server ping received"
|
44
|
-
else
|
45
|
-
logger.debug "#{JSON.parse(line).to_s}"
|
46
|
-
end
|
47
|
-
|
48
|
-
client.interrupt if line_count > NUM_JSON_RECORDS_TO_RECEIVE }
|
49
|
-
}
|
50
|
-
rescue Timeout::Error
|
51
|
-
logger.debug "Timeout occurred, #{TIMEOUT_SEC} seconds elapsed"
|
52
|
-
client.interrupt
|
53
|
-
end
|
54
|
-
}.to_not raise_error
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
describe "adobe firehose streaming get test, no compression, no block" do
|
59
|
-
|
60
|
-
url = TOKENAPIHOST
|
61
|
-
authorization = HttpStreamingClient::Oauth::Adobe.generate_authorization(url, USERNAME, PASSWORD, CLIENTID, CLIENTSECRET)
|
62
|
-
|
63
|
-
subject { authorization }
|
64
|
-
it { should_not be_nil}
|
65
|
-
it { should be_instance_of(String) }
|
66
|
-
|
67
|
-
line_count = 0
|
68
|
-
|
69
|
-
it "should successfully retrieve JSON records from the firehose" do
|
70
|
-
expect {
|
71
|
-
client = HttpStreamingClient::Client.new(compression: false)
|
72
|
-
begin
|
73
|
-
status = Timeout::timeout(5) {
|
74
|
-
response = client.get(STREAMURL, {:headers => {'Authorization' => "Bearer #{authorization}" }})
|
75
|
-
}
|
76
|
-
rescue Timeout::Error
|
77
|
-
logger.debug "Timeout occurred, #{TIMEOUT_SEC} seconds elapsed"
|
78
|
-
client.interrupt
|
79
|
-
end
|
80
|
-
}.to_not raise_error
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
12
|
describe "adobe firehose streaming get test, GZIP compression" do
|
85
13
|
|
86
14
|
url = TOKENAPIHOST
|
@@ -111,7 +39,7 @@ describe HttpStreamingClient do
|
|
111
39
|
|
112
40
|
line_count = line_count + 1
|
113
41
|
|
114
|
-
if line.eql? "\r\n" then
|
42
|
+
if line.eql? "\r\n" or line.eql? "\r\n\r\n" then
|
115
43
|
logger.debug "Server ping received"
|
116
44
|
else
|
117
45
|
logger.debug "#{JSON.parse(line).to_s}"
|
data/tools/adobe_firehose.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http_streaming_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Tompkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|