fluent-plugin-azureeventhubs-batched 0.0.1 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fluent-plugin-azureeventhubs-batched.gemspec +2 -1
- data/lib/fluent/plugin/azureeventhubs/http.rb +12 -16
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56119b705cc8a8abc11097ddeef4f572b6a36a814b96326e3b065c634d7f3c75
|
4
|
+
data.tar.gz: 86ef4b5652e291f9a599eeee5c07b5b41d0b586d1d2270c6a8dd760a325111ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cc921cddf45da51aea44aa9a2c725cb921800aa1e49e7b6747f79e8a603441d8238c0ab1e831320663aae58d2e3c913f1551af588f84d7b92a24a1db85aab77
|
7
|
+
data.tar.gz: 45d27618bdf9f127342509124093e12b71a853c89b072ad2fadff23ab2260b562f6f55c6ed11f9fedc8275310b5546569ab15d01abffe0376f62205d32c97895
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "fluent-plugin-azureeventhubs-batched"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.8"
|
8
8
|
spec.authors = ["Hidemasa Togashi", "Toddy Mladenov", "Justin Seely", "Chih Hsiang Hsu"]
|
9
9
|
spec.email = ["togachiro@gmail.com", "toddysm@gmail.com", "s8901489@gmail.com"]
|
10
10
|
spec.summary = "Fluentd output plugin for Azure Event Hubs"
|
@@ -20,4 +20,5 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.add_development_dependency "bundler", "~> 1.7"
|
21
21
|
spec.add_development_dependency "rake", "~> 10.0"
|
22
22
|
spec.add_dependency "fluentd", [">= 0.14.15", "< 2"]
|
23
|
+
spec.add_dependency "httpclient", ">= 2.8.3"
|
23
24
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
class AzureEventHubsHttpSender
|
3
2
|
def initialize(connection_string, hub_name, expiry=3600,proxy_addr='',proxy_port=3128,open_timeout=60,read_timeout=60)
|
4
3
|
require 'openssl'
|
@@ -7,6 +6,7 @@ class AzureEventHubsHttpSender
|
|
7
6
|
require 'json'
|
8
7
|
require 'cgi'
|
9
8
|
require 'time'
|
9
|
+
require 'httpclient'
|
10
10
|
@connection_string = connection_string
|
11
11
|
@hub_name = hub_name
|
12
12
|
@expiry_interval = expiry
|
@@ -29,6 +29,13 @@ class AzureEventHubsHttpSender
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
@uri = URI.parse("#{@endpoint}#{@hub_name}/messages")
|
32
|
+
|
33
|
+
if (proxy_addr.to_s.empty?)
|
34
|
+
@client = HTTPClient.new
|
35
|
+
else
|
36
|
+
proxy_url = "#{proxy_addr}:#{proxy_port}"
|
37
|
+
@client = HTTPClient.new(proxy)
|
38
|
+
end
|
32
39
|
end
|
33
40
|
|
34
41
|
def generate_sas_token(uri)
|
@@ -56,19 +63,8 @@ class AzureEventHubsHttpSender
|
|
56
63
|
if not properties.nil?
|
57
64
|
headers = headers.merge(properties)
|
58
65
|
end
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
https.read_timeout = @read_timeout
|
63
|
-
else
|
64
|
-
https = Net::HTTP.new(@uri.host, @uri.port,@proxy_addr,@proxy_port)
|
65
|
-
https.open_timeout = @open_timeout
|
66
|
-
https.read_timeout = @read_timeout
|
67
|
-
end
|
68
|
-
https.use_ssl = true
|
69
|
-
req = Net::HTTP::Post.new(@uri.request_uri, headers)
|
70
|
-
req.body = payload.to_json
|
71
|
-
res = https.request(req)
|
72
|
-
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError, Errno::ETIMEDOUT, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e
|
66
|
+
body = payload.to_json
|
67
|
+
res = @client.post(@uri.to_s, body, headers)
|
68
|
+
rescue HTTPClient::TimeoutError, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError, Errno::ETIMEDOUT, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e
|
73
69
|
end
|
74
|
-
end
|
70
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-azureeventhubs-batched
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hidemasa Togashi
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2021-
|
14
|
+
date: 2021-04-09 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -61,6 +61,20 @@ dependencies:
|
|
61
61
|
- - "<"
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: '2'
|
64
|
+
- !ruby/object:Gem::Dependency
|
65
|
+
name: httpclient
|
66
|
+
requirement: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 2.8.3
|
71
|
+
type: :runtime
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 2.8.3
|
64
78
|
description: Fluentd output plugin for Azure Event Hubs
|
65
79
|
email:
|
66
80
|
- togachiro@gmail.com
|