fluent-plugin-azureeventhubs 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e3a54871973cb83319bea0a414a183e3108c7e7
4
- data.tar.gz: 8844910f004dd600afa6aab33a1f7c1e3de89ce3
3
+ metadata.gz: c0e21c7faa856d74f4f8f195b71e065525213a47
4
+ data.tar.gz: 79c2b13e680d28b268003b6013c5769d295f082e
5
5
  SHA512:
6
- metadata.gz: 23236af56257c72f7bde1af3ca90333648fd65a9b29f3455a609d7f5759a564c22b3ba396b93f8111d6474a08c91a3e95d5ae6371936cf041f7827ccc7418b90
7
- data.tar.gz: b98b702169f028d1d49cc6d2c5c5acc3e881b381bcb8bae95707dcd35feddf8d64008bb92954e2f4433ad952f169faddb8b60fd7f1b11ab0b88a387bd94e2676
6
+ metadata.gz: f50fd3712de1735926668d0f957d46104730d7789b35f7e23928db89385c6a2881c960649129c45d2dfa7f5b2461a517e951d464bd6b6e6c9394f9a07819a7ae
7
+ data.tar.gz: b67f030f8d6827bcc51e89853e06db30e61f8f4f220ca9ffe076094474ff332e8ffd4f86e173fb834e353ab2357e7e2ccb9e76fb9fc95517a0eedf5a8b3be8e9
data/README.md CHANGED
@@ -33,6 +33,8 @@ Or install it yourself as:
33
33
  expiry_interval <Integer number> # Signature expiration time interval in seconds. [Optional: default => 3600 (60min)]
34
34
  proxy_addr <Host or IP> # Address of the proxy [Optional]
35
35
  proxy_port <Integer> # Proxy port. [Optional: default => 3128]
36
+ read_timeout <Integer> # HTTP Read timeout in seconds[Optional: default => 60]
37
+ open_timeout <Integer> # HTTP Open timeout in seconds[Optional: default => 60]
36
38
  </match>
37
39
  ```
38
40
 
@@ -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"
7
- spec.version = "0.0.3"
7
+ spec.version = "0.0.4"
8
8
  spec.authors = ["Hidemasa Togashi"]
9
9
  spec.email = ["togachiro@gmail.com"]
10
10
  spec.summary = "Fluentd output plugin for Azure Event Hubs"
@@ -1,6 +1,6 @@
1
1
 
2
2
  class AzureEventHubsHttpSender
3
- def initialize(connection_string, hub_name, expiry=3600,proxy_addr='',proxy_port=3128)
3
+ def initialize(connection_string, hub_name, expiry=3600,proxy_addr='',proxy_port=3128,open_timeout=60,read_timeout=60)
4
4
  require 'openssl'
5
5
  require 'base64'
6
6
  require 'net/http'
@@ -12,6 +12,8 @@ class AzureEventHubsHttpSender
12
12
  @expiry_interval = expiry
13
13
  @proxy_addr = proxy_addr
14
14
  @proxy_port = proxy_port
15
+ @open_timeout = open_timeout
16
+ @read_timeout = read_timeout
15
17
 
16
18
  if @connection_string.count(';') != 2
17
19
  raise "Connection String format is not correct"
@@ -49,12 +51,17 @@ class AzureEventHubsHttpSender
49
51
  }
50
52
  if (@proxy_addr.to_s.empty?)
51
53
  https = Net::HTTP.new(@uri.host, @uri.port)
54
+ https.open_timeout = @open_timeout
55
+ https.read_timeout = @read_timeout
52
56
  else
53
57
  https = Net::HTTP.new(@uri.host, @uri.port,@proxy_addr,@proxy_port)
58
+ https.open_timeout = @open_timeout
59
+ https.read_timeout = @read_timeout
54
60
  end
55
61
  https.use_ssl = true
56
62
  req = Net::HTTP::Post.new(@uri.request_uri, headers)
57
63
  req.body = payload.to_json
58
64
  res = https.request(req)
65
+ rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError, Errno::ETIMEDOUT, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e
59
66
  end
60
67
  end
@@ -12,6 +12,8 @@
12
12
  config_param :type, :string, :default => 'https' # https / amqps (Not Implemented)
13
13
  config_param :proxy_addr, :string, :default => ''
14
14
  config_param :proxy_port, :integer,:default => 3128
15
+ config_param :open_timeout, :integer,:default => 60
16
+ config_param :read_timeout, :integer,:default => 60
15
17
 
16
18
  def configure(conf)
17
19
  super
@@ -20,7 +22,7 @@
20
22
  raise NotImplementedError
21
23
  else
22
24
  require_relative 'azureeventhubs/http'
23
- @sender = AzureEventHubsHttpSender.new(@connection_string, @hub_name, @expiry_interval,@proxy_addr,@proxy_port)
25
+ @sender = AzureEventHubsHttpSender.new(@connection_string, @hub_name, @expiry_interval,@proxy_addr,@proxy_port,@open_timeout,@read_timeout)
24
26
  end
25
27
  end
26
28
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-azureeventhubs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hidemasa Togashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-05 00:00:00.000000000 Z
11
+ date: 2016-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler