logstash-input-azure_event_hubs 1.2.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 636123e36c33570aaf89bdcc73ea5278e12d31c82744b8438d3e547a2e26226d
4
- data.tar.gz: 04d9bcdd2cf90d9cbd9618c029e296d6d67ba4925da1d47a2ed6178955b3cf26
3
+ metadata.gz: f90b79dfae3e67cbaf4d5fd164760332bac2b60467abc04ea35050b938646ea7
4
+ data.tar.gz: fc5dde1bc64cc82d28522b79958a5cda08c7208f3fd69167b5a3639bbdb0536f
5
5
  SHA512:
6
- metadata.gz: ff260a97dbed5ba989b14752858893eeec2a94ed1774e07c509987c709a5e91459128e5ca8680f4f7a42be2918694cb176aa74d83707101ff35e09f8557d743a
7
- data.tar.gz: 22a1e7019abc970d1fbba51162f7dea7cce8f0070f82a31ecfe24e95cad8380c8949b0ee51352e608f5d01cf50fd5f9578c26da3ba654356e8da69a8471164d8
6
+ metadata.gz: 2e74ccf4e7293b76a2b5913c558a59692ccb3d284448b78059eb49104cc85a3604f0548a3b2b567bf841ddac6659d9105f03979ff46b2603937182ac5009d0e4
7
+ data.tar.gz: 91e7c1e01871badb346c6381304047aae7d507e431919de040b258e0678c5f3f5d559e1aec07e065e25901330fccec1a82643288f4e4f0f2644f1ceb4dde73aa
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 1.4.0
2
+ - Updated the minor version of Azure SDK and other dependencies to ensure users of this plugin get upstream fixes and improvements [#67](https://github.com/logstash-plugins/logstash-input-azure_event_hubs/pull/67)
3
+
4
+ ## 1.3.0
5
+ - Add EventHub `user properties` in `@metadata` object [#66](https://github.com/logstash-plugins/logstash-input-azure_event_hubs/pull/66)
6
+
7
+ ## 1.2.3
8
+ - Fixed missing configuration of `prefetch_count` and `receive_timeout` [#61](https://github.com/logstash-plugins/logstash-input-azure_event_hubs/pull/61)
9
+
10
+ ## 1.2.2
11
+ - Refactor: scope and review global java_imports [#57](https://github.com/logstash-plugins/logstash-input-azure_event_hubs/pull/57)
12
+
1
13
  ## 1.2.1
2
14
  - [DOC] Changed documentation to update the default number of threads [#55](https://github.com/logstash-plugins/logstash-input-azure_event_hubs/pull/55)
3
15
 
@@ -34,6 +46,6 @@
34
46
  ## 1.0.1
35
47
  - Fixed logging for exception handler
36
48
 
37
- ## 1.0.0
49
+ ## 1.0.0
38
50
  - Initial release of `logstash-input-azure_event_hubs` supersedes `logstash-input-azureeventhub`
39
51
  - Re-implementation that uses Event Processor Host API and new configuration options.
data/LICENSE CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  Apache License
2
3
  Version 2.0, January 2004
3
4
  http://www.apache.org/licenses/
@@ -186,7 +187,7 @@
186
187
  same "printed page" as the copyright notice for easier
187
188
  identification within third-party archives.
188
189
 
189
- Copyright [yyyy] [name of copyright owner]
190
+ Copyright 2020 Elastic and contributors
190
191
 
191
192
  Licensed under the Apache License, Version 2.0 (the "License");
192
193
  you may not use this file except in compliance with the License.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.1
1
+ 1.4.0
@@ -8,18 +8,18 @@ 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
+ java_import java.time.Duration
21
22
 
22
- class LogStash::Inputs::AzureEventHubs < LogStash::Inputs::Base
23
23
  config_name "azure_event_hubs"
24
24
 
25
25
  # This plugin supports two styles of configuration
@@ -291,7 +291,7 @@ class LogStash::Inputs::AzureEventHubs < LogStash::Inputs::Base
291
291
  # }
292
292
  config :decorate_events, :validate => :boolean, :default => false
293
293
 
294
- attr_reader :count, :pre_count
294
+ attr_reader :count
295
295
 
296
296
  def initialize(params)
297
297
 
@@ -410,6 +410,9 @@ class LogStash::Inputs::AzureEventHubs < LogStash::Inputs::Base
410
410
  end
411
411
  options = EventProcessorOptions.new
412
412
  options.setMaxBatchSize(max_batch_size)
413
+ options.setPrefetchCount(prefetch_count)
414
+ options.setReceiveTimeOut(Duration.ofSeconds(receive_timeout))
415
+
413
416
  options.setExceptionNotification(LogStash::Inputs::Azure::ErrorNotificationHandler.new)
414
417
  case @initial_position
415
418
  when 'beginning'
@@ -476,5 +479,3 @@ class LogStash::Inputs::AzureEventHubs < LogStash::Inputs::Base
476
479
  end
477
480
  end
478
481
  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
- include Function
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)
@@ -48,6 +48,7 @@ module LogStash
48
48
  event.set("[@metadata][azure_event_hubs][sequence]", payload.getSystemProperties.getSequenceNumber)
49
49
  event.set("[@metadata][azure_event_hubs][timestamp]",payload.getSystemProperties.getEnqueuedTime.getEpochSecond)
50
50
  event.set("[@metadata][azure_event_hubs][event_size]", bytes.size)
51
+ event.set("[@metadata][azure_event_hubs][user_properties]", payload.getProperties)
51
52
  end
52
53
  @queue << event
53
54
  if @checkpoint_interval > 0
@@ -1,5 +1,6 @@
1
1
  # encoding: utf-8
2
2
  require "logstash/inputs/processor"
3
+
3
4
  module LogStash
4
5
  module Inputs
5
6
  module Azure
@@ -22,6 +23,3 @@ module LogStash
22
23
  end
23
24
  end
24
25
  end
25
-
26
-
27
-
@@ -2,10 +2,10 @@
2
2
 
3
3
  require 'jar_dependencies'
4
4
  require_jar('com.google.code.gson', 'gson', '2.8.5')
5
- require_jar('org.apache.qpid', 'proton-j', '0.33.3')
5
+ require_jar('org.apache.qpid', 'proton-j', '0.33.9')
6
6
  require_jar('org.apache.logging.log4j', 'log4j-slf4j-impl', '2.9.1')
7
- require_jar('com.microsoft.azure', 'azure-eventhubs', '2.2.0')
8
- require_jar('com.microsoft.azure', 'qpid-proton-j-extensions', '1.1.0')
9
- require_jar('com.microsoft.azure', 'azure-eventhubs-eph', '2.4.0')
10
- require_jar('com.microsoft.azure', 'azure-storage', '8.0.0')
7
+ require_jar('com.microsoft.azure', 'azure-eventhubs', '2.3.2')
8
+ require_jar('com.microsoft.azure', 'qpid-proton-j-extensions', '1.2.4')
9
+ require_jar('com.microsoft.azure', 'azure-eventhubs-eph', '2.5.2')
10
+ require_jar('com.microsoft.azure', 'azure-storage', '8.6.6')
11
11
  require_jar('org.apache.logging.log4j', 'log4j-api', '2.9.1')
@@ -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
 
@@ -28,7 +21,7 @@ describe LogStash::Inputs::AzureEventHubs do
28
21
  expect(exploded_config[i]['event_hub_connections'][0].value).to start_with('Endpoint=sb://...')
29
22
  expect(exploded_config[i]['storage_connection'].value).to eql('DefaultEndpointsProtocol=https;AccountName=...')
30
23
  expect(exploded_config[i]['threads']).to be == 9
31
- expect(exploded_config[i]['codec']).to be_a_kind_of(LogStash::Codecs::Plain)
24
+ expect(exploded_config[i]['codec'].class.to_s).to eq("LogStash::Codecs::Plain")
32
25
  expect(exploded_config[i]['consumer_group']).to eql('cg')
33
26
  expect(exploded_config[i]['max_batch_size']).to be == 20
34
27
  expect(exploded_config[i]['prefetch_count']).to be == 30
@@ -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"}
@@ -186,7 +179,7 @@ describe LogStash::Inputs::AzureEventHubs do
186
179
  expect(exploded_config[1]['event_hub_connections'][0].value).to eql('1Endpoint=sb://...')
187
180
  expect(exploded_config[1]['storage_connection'].value).to eql('1DefaultEndpointsProtocol=https;AccountName=...')
188
181
  expect(exploded_config[1]['threads']).to be == 9
189
- expect(exploded_config[1]['codec']).to be_a_kind_of(LogStash::Codecs::JSON) # different between configs
182
+ expect(exploded_config[1]['codec'].class.to_s).to eq("LogStash::Codecs::JSON") # different between configs
190
183
  expect(exploded_config[1]['consumer_group']).to eql('cg1') # override global
191
184
  expect(exploded_config[1]['max_batch_size']).to be == 21 # filled from global
192
185
  expect(exploded_config[1]['prefetch_count']).to be == 300 # default
@@ -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.1
4
+ version: 1.4.0
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-12 00:00:00.000000000 Z
11
+ date: 2021-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -104,13 +104,13 @@ files:
104
104
  - logstash-input-azure_event_hubs.gemspec
105
105
  - spec/inputs/azure_event_hub_spec.rb
106
106
  - vendor/jar-dependencies/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar
107
- - vendor/jar-dependencies/com/microsoft/azure/azure-eventhubs-eph/2.4.0/azure-eventhubs-eph-2.4.0.jar
108
- - vendor/jar-dependencies/com/microsoft/azure/azure-eventhubs/2.2.0/azure-eventhubs-2.2.0.jar
109
- - vendor/jar-dependencies/com/microsoft/azure/azure-storage/8.0.0/azure-storage-8.0.0.jar
110
- - vendor/jar-dependencies/com/microsoft/azure/qpid-proton-j-extensions/1.1.0/qpid-proton-j-extensions-1.1.0.jar
107
+ - vendor/jar-dependencies/com/microsoft/azure/azure-eventhubs-eph/2.5.2/azure-eventhubs-eph-2.5.2.jar
108
+ - vendor/jar-dependencies/com/microsoft/azure/azure-eventhubs/2.3.2/azure-eventhubs-2.3.2.jar
109
+ - vendor/jar-dependencies/com/microsoft/azure/azure-storage/8.6.6/azure-storage-8.6.6.jar
110
+ - vendor/jar-dependencies/com/microsoft/azure/qpid-proton-j-extensions/1.2.4/qpid-proton-j-extensions-1.2.4.jar
111
111
  - vendor/jar-dependencies/org/apache/logging/log4j/log4j-api/2.9.1/log4j-api-2.9.1.jar
112
112
  - vendor/jar-dependencies/org/apache/logging/log4j/log4j-slf4j-impl/2.9.1/log4j-slf4j-impl-2.9.1.jar
113
- - vendor/jar-dependencies/org/apache/qpid/proton-j/0.33.3/proton-j-0.33.3.jar
113
+ - vendor/jar-dependencies/org/apache/qpid/proton-j/0.33.9/proton-j-0.33.9.jar
114
114
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
115
115
  licenses:
116
116
  - Apache-2.0
@@ -133,8 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  - !ruby/object:Gem::Version
134
134
  version: '0'
135
135
  requirements: []
136
- rubyforge_project:
137
- rubygems_version: 2.6.13
136
+ rubygems_version: 3.1.6
138
137
  signing_key:
139
138
  specification_version: 4
140
139
  summary: Consumes events from Azure Event Hubs for use with Logstash