logstash-input-azure_event_hubs 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/VERSION +1 -1
- data/lib/logstash/inputs/azure_event_hubs.rb +9 -12
- data/lib/logstash/inputs/error_notification_handler.rb +3 -4
- data/lib/logstash/inputs/look_back_position_provider.rb +5 -4
- data/lib/logstash/inputs/processor_factory.rb +1 -3
- data/spec/inputs/azure_event_hub_spec.rb +10 -18
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a7f87055eb3012bebd2fbe41eb12130c8ce91aa4853d56493e77de3e3eb1d32
|
4
|
+
data.tar.gz: 7d7be20be2704119f1cbe6e84d3f290d258a6063bdd4bea366dfab24d9be9af5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4153e44540964e59f5ca7a57389f418f1283c0dd679df9c7895be67527ad6b8214fd762940c06c191b924a187114ed435e87eb9bf58f7d57f11f96131688a788
|
7
|
+
data.tar.gz: 00c56ff144753427ee5c1e3b2dcc29dde057efee95434c2bbd0bb6736d3144add8f9d01df6d0efff9f0e084c73d698ed6f8cfeb1cecfb36acb5e501c2eb78f55
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 1.2.2
|
2
|
+
- Refactor: scope and review global java_imports [#57](https://github.com/logstash-plugins/logstash-input-azure_event_hubs/pull/57)
|
3
|
+
|
1
4
|
## 1.2.1
|
2
5
|
- [DOC] Changed documentation to update the default number of threads [#55](https://github.com/logstash-plugins/logstash-input-azure_event_hubs/pull/55)
|
3
6
|
|
@@ -34,6 +37,6 @@
|
|
34
37
|
## 1.0.1
|
35
38
|
- Fixed logging for exception handler
|
36
39
|
|
37
|
-
## 1.0.0
|
40
|
+
## 1.0.0
|
38
41
|
- Initial release of `logstash-input-azure_event_hubs` supersedes `logstash-input-azureeventhub`
|
39
42
|
- Re-implementation that uses Event Processor Host API and new configuration options.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.2
|
@@ -8,18 +8,17 @@ require "logstash/inputs/error_notification_handler"
|
|
8
8
|
require "logstash/inputs/named_thread_factory"
|
9
9
|
require "logstash/inputs/look_back_position_provider"
|
10
10
|
|
11
|
+
class LogStash::Inputs::AzureEventHubs < LogStash::Inputs::Base
|
11
12
|
|
12
|
-
java_import com.microsoft.azure.eventprocessorhost.EventProcessorHost
|
13
|
-
java_import com.microsoft.azure.eventprocessorhost.EventProcessorOptions
|
14
|
-
java_import com.microsoft.azure.eventprocessorhost.InMemoryCheckpointManager
|
15
|
-
java_import com.microsoft.azure.eventprocessorhost.InMemoryLeaseManager
|
16
|
-
java_import com.microsoft.azure.eventprocessorhost.HostContext
|
17
|
-
java_import com.microsoft.azure.eventhubs.ConnectionStringBuilder
|
18
|
-
java_import java.util.concurrent.Executors
|
19
|
-
java_import java.util.concurrent.TimeUnit
|
20
|
-
|
13
|
+
java_import com.microsoft.azure.eventprocessorhost.EventProcessorHost
|
14
|
+
java_import com.microsoft.azure.eventprocessorhost.EventProcessorOptions
|
15
|
+
java_import com.microsoft.azure.eventprocessorhost.InMemoryCheckpointManager
|
16
|
+
java_import com.microsoft.azure.eventprocessorhost.InMemoryLeaseManager
|
17
|
+
java_import com.microsoft.azure.eventprocessorhost.HostContext
|
18
|
+
java_import com.microsoft.azure.eventhubs.ConnectionStringBuilder
|
19
|
+
java_import java.util.concurrent.Executors
|
20
|
+
java_import java.util.concurrent.TimeUnit
|
21
21
|
|
22
|
-
class LogStash::Inputs::AzureEventHubs < LogStash::Inputs::Base
|
23
22
|
config_name "azure_event_hubs"
|
24
23
|
|
25
24
|
# This plugin supports two styles of configuration
|
@@ -476,5 +475,3 @@ class LogStash::Inputs::AzureEventHubs < LogStash::Inputs::Base
|
|
476
475
|
end
|
477
476
|
end
|
478
477
|
end
|
479
|
-
|
480
|
-
|
@@ -1,12 +1,11 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require "logstash/util/loggable"
|
3
|
-
java_import java.util.function.Consumer
|
4
3
|
|
5
4
|
module LogStash
|
6
5
|
module Inputs
|
7
6
|
module Azure
|
8
7
|
class ErrorNotificationHandler
|
9
|
-
include Consumer
|
8
|
+
include java.util.function.Consumer
|
10
9
|
include LogStash::Util::Loggable
|
11
10
|
|
12
11
|
def initialize
|
@@ -14,9 +13,9 @@ module LogStash
|
|
14
13
|
end
|
15
14
|
|
16
15
|
def accept(exception_received_event_args)
|
17
|
-
@logger.error("Error with Event Processor Host. ",
|
16
|
+
@logger.error("Error with Event Processor Host. ",
|
18
17
|
:host_name => exception_received_event_args.getHostname(),
|
19
|
-
:action => exception_received_event_args.getAction(),
|
18
|
+
:action => exception_received_event_args.getAction(),
|
20
19
|
:exception => exception_received_event_args.getException().toString())
|
21
20
|
end
|
22
21
|
end
|
@@ -1,14 +1,15 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require "logstash/util/loggable"
|
3
|
-
java_import java.util.function.Function
|
4
|
-
java_import com.microsoft.azure.eventhubs.EventPosition
|
5
|
-
java_import java.time.Instant
|
6
3
|
|
7
4
|
module LogStash
|
8
5
|
module Inputs
|
9
6
|
module Azure
|
10
7
|
class LookBackPositionProvider
|
11
|
-
|
8
|
+
|
9
|
+
java_import com.microsoft.azure.eventhubs.EventPosition
|
10
|
+
java_import java.time.Instant
|
11
|
+
|
12
|
+
include java.util.function.Function
|
12
13
|
include LogStash::Util::Loggable
|
13
14
|
|
14
15
|
def initialize(look_back_seconds)
|
@@ -2,16 +2,9 @@
|
|
2
2
|
require "logstash/devutils/rspec/spec_helper"
|
3
3
|
require "logstash/inputs/azure_event_hubs"
|
4
4
|
|
5
|
-
|
6
5
|
java_import com.microsoft.azure.eventprocessorhost.EventProcessorHost
|
7
|
-
java_import com.microsoft.azure.eventprocessorhost.EventProcessorOptions
|
8
6
|
java_import com.microsoft.azure.eventprocessorhost.InMemoryCheckpointManager
|
9
7
|
java_import com.microsoft.azure.eventprocessorhost.InMemoryLeaseManager
|
10
|
-
java_import java.util.concurrent.ScheduledThreadPoolExecutor
|
11
|
-
java_import java.util.concurrent.CompletableFuture
|
12
|
-
java_import java.util.concurrent.TimeUnit
|
13
|
-
java_import java.util.concurrent.atomic.AtomicInteger
|
14
|
-
|
15
8
|
|
16
9
|
describe LogStash::Inputs::AzureEventHubs do
|
17
10
|
|
@@ -67,7 +60,7 @@ describe LogStash::Inputs::AzureEventHubs do
|
|
67
60
|
mock_queue = double("queue")
|
68
61
|
mock_host = double("event_processor_host")
|
69
62
|
mock_host_context = double("host_context")
|
70
|
-
completable_future = CompletableFuture.new
|
63
|
+
completable_future = java.util.concurrent.CompletableFuture.new
|
71
64
|
#simulate work being done before completing the future
|
72
65
|
Thread.new do
|
73
66
|
sleep 2
|
@@ -75,10 +68,10 @@ describe LogStash::Inputs::AzureEventHubs do
|
|
75
68
|
end
|
76
69
|
|
77
70
|
# rspec has issues with counters and concurrent code, so use threadsafe counters instead
|
78
|
-
host_counter = AtomicInteger.new
|
79
|
-
register_counter = AtomicInteger.new
|
80
|
-
unregister_counter = AtomicInteger.new
|
81
|
-
assertion_count = AtomicInteger.new
|
71
|
+
host_counter = java.util.concurrent.atomic.AtomicInteger.new
|
72
|
+
register_counter = java.util.concurrent.atomic.AtomicInteger.new
|
73
|
+
unregister_counter = java.util.concurrent.atomic.AtomicInteger.new
|
74
|
+
assertion_count = java.util.concurrent.atomic.AtomicInteger.new
|
82
75
|
|
83
76
|
allow(mock_host).to receive(:getHostContext) {mock_host_context}
|
84
77
|
allow(mock_host_context).to receive(:getEventHubPath) {"foo"}
|
@@ -202,7 +195,7 @@ describe LogStash::Inputs::AzureEventHubs do
|
|
202
195
|
mock_queue = double("queue")
|
203
196
|
mock_host = double("event_processor_host")
|
204
197
|
mock_host_context = double("host_context")
|
205
|
-
completable_future = CompletableFuture.new
|
198
|
+
completable_future = java.util.concurrent.CompletableFuture.new
|
206
199
|
#simulate work being done before completing the future
|
207
200
|
Thread.new do
|
208
201
|
sleep 2
|
@@ -210,10 +203,10 @@ describe LogStash::Inputs::AzureEventHubs do
|
|
210
203
|
end
|
211
204
|
|
212
205
|
# rspec has issues with counters and concurrent code, so use threadsafe counters instead
|
213
|
-
host_counter = AtomicInteger.new
|
214
|
-
register_counter = AtomicInteger.new
|
215
|
-
unregister_counter = AtomicInteger.new
|
216
|
-
assertion_count = AtomicInteger.new
|
206
|
+
host_counter = java.util.concurrent.atomic.AtomicInteger.new
|
207
|
+
register_counter = java.util.concurrent.atomic.AtomicInteger.new
|
208
|
+
unregister_counter = java.util.concurrent.atomic.AtomicInteger.new
|
209
|
+
assertion_count = java.util.concurrent.atomic.AtomicInteger.new
|
217
210
|
allow_any_instance_of(InMemoryLeaseManager).to receive(:java_send)
|
218
211
|
allow_any_instance_of(InMemoryCheckpointManager).to receive(:java_send)
|
219
212
|
|
@@ -319,4 +312,3 @@ describe LogStash::Inputs::AzureEventHubs do
|
|
319
312
|
end
|
320
313
|
end
|
321
314
|
end
|
322
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-azure_event_hubs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|