Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 7.0.3
- Refactor: scope (and remove unused) java imports [#29](https://github.com/logstash-plugins/logstash-integration-rabbitmq/pull/29)

## 7.0.2
- Fixes issue in Output where failure to register connection reovery hooks prevented the output from starting

Expand Down
5 changes: 3 additions & 2 deletions lib/logstash/inputs/rabbitmq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
require_relative '../plugin_mixins/rabbitmq_connection'
require 'logstash/inputs/threadable'
require 'logstash/event'
java_import java.util.concurrent.ArrayBlockingQueue
java_import java.util.concurrent.TimeUnit

module LogStash
module Inputs
Expand Down Expand Up @@ -59,6 +57,9 @@ module Inputs
# Additionally, any message headers will be saved in the
# `[@metadata][rabbitmq_headers]` field.
class RabbitMQ < LogStash::Inputs::Threadable

java_import java.util.concurrent.TimeUnit

include ::LogStash::PluginMixins::RabbitMQConnection

# The properties to extract from each message and store in a
Expand Down
12 changes: 7 additions & 5 deletions lib/logstash/outputs/rabbitmq.rb
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
# encoding: UTF-8
require "logstash/pipeline"
require_relative '../plugin_mixins/rabbitmq_connection'
java_import java.util.concurrent.TimeoutException
java_import com.rabbitmq.client.AlreadyClosedException

require 'back_pressure'

# Push events to a RabbitMQ exchange. Requires RabbitMQ 2.x
# or later version (3.x is recommended).
#
#
# Relevant links:
#
# * http://www.rabbitmq.com/[RabbitMQ]
# * http://rubymarchhare.info[March Hare]
module LogStash
module Outputs
class RabbitMQ < LogStash::Outputs::Base

java_import java.util.concurrent.TimeoutException
java_import com.rabbitmq.client.AlreadyClosedException

include LogStash::PluginMixins::RabbitMQConnection

config_name "rabbitmq"

concurrency :shared

# The default codec for this plugin is JSON. You can override this to suit your particular needs however.
Expand Down Expand Up @@ -128,4 +130,4 @@ def back_pressure_provider_for_connection(march_hare_connection)
end
end
end
end
end
2 changes: 1 addition & 1 deletion logstash-integration-rabbitmq.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'logstash-integration-rabbitmq'
s.version = '7.0.2'
s.version = '7.0.3'
s.licenses = ['Apache License (2.0)']
s.summary = "Integration with RabbitMQ - input and output plugins"
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline "+
Expand Down
3 changes: 1 addition & 2 deletions spec/outputs/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require "logstash/devutils/rspec/spec_helper"
require "logstash/pipeline"
require "logstash/outputs/rabbitmq"
java_import java.util.concurrent.TimeoutException

describe LogStash::Outputs::RabbitMQ do
let(:klass) { LogStash::Outputs::RabbitMQ }
Expand Down Expand Up @@ -124,7 +123,7 @@
end

context 'when it is a TimeoutException' do
let(:exception) { TimeoutException.new }
let(:exception) { java.util.concurrent.TimeoutException.new }
it_behaves_like 'recovers from exception gracefully'
end
end
Expand Down