logstash-output-jms 3.0.3 → 3.0.4

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: fc40b0019682516e29929ca3cff34388aca968efb37d45bdc293e86d8bc0e2c3
4
- data.tar.gz: 93cf282e0e42ed4abe5ad3975f24e602294992f0cd7c2934416f7dda40104ab7
3
+ metadata.gz: e8c6884ef9fed2c5e1f52d37d32f01bcb1521381cfb1b8355a80483d6004e39a
4
+ data.tar.gz: 83dcf48a5d1851be6c39b55992f98c72140dab4fd55046b037a328d5a952b25b
5
5
  SHA512:
6
- metadata.gz: a7ba4161f4f739edebd5e205e47ecb4cd9f9adaf46de0989777a2ee82f8a6855f394dcd5a9dd559d78118cf789eb123c4cc3fe7f4c7c8b8adaa54a577e6d6e1a
7
- data.tar.gz: 9a7b0913a86792e0ac8f65e516272d90bf152853db3d901c370d29bfac10702508baa2b6ba5228089a61751ff6a6a8eb901c3b2b581501c6d9d1fd22ad8a0824
6
+ metadata.gz: b0b8b4672024ffa12932af9562dfc7e365b818624887893317642a0bf40eceb8cb881787168e00e715adcd6908b035f4278d571b9028773bdde769b0dfc86fcf
7
+ data.tar.gz: 296bf31b7e15bf1ca755060b94f62f59ede467132ed363d22fcb736d5a2aeee8d03f82735b27b8dab810307b027fc9fa406e7688d8ff2a0962644beaa5b5fd79
@@ -1,3 +1,6 @@
1
+ ## 3.0.4
2
+ - Fixes an issue where `delivery_mode` directive was silently ignored.
3
+
1
4
  ## 3.0.3
2
5
  - Docs: Set the default_codec doc attribute.
3
6
 
@@ -23,7 +23,7 @@ class LogStash::Outputs::Jms < LogStash::Outputs::Base
23
23
 
24
24
  # Name of delivery mode to use
25
25
  # Options are "persistent" and "non_persistent" if not defined nothing will be passed.
26
- config :delivery_mode, :validate => :string, :default => nil
26
+ config :delivery_mode, :validate => %w(persistent non_persistent)
27
27
 
28
28
  # If pub-sub (topic) style should be used or not.
29
29
  # Mandatory
@@ -95,16 +95,27 @@ config :jndi_context, :validate => :hash
95
95
  end
96
96
 
97
97
  @logger.debug("JMS Config being used", :context => @jms_config)
98
- @connection = JMS::Connection.new(@jms_config)
98
+ begin
99
+ # The jruby-jms adapter dynamically loads the Java classes that it extends, and may fail
100
+ @connection = JMS::Connection.new(@jms_config)
101
+ rescue NameError => ne
102
+ if @require_jars && !@require_jars.empty?
103
+ logger.warn('The `require_jars` directive was provided, but may not correctly map to a JNS provider', :require_jars => @require_jars)
104
+ end
105
+ logger.error('Failed to load JMS Connection, likely because a JMS Provider is not on the Logstash classpath '+
106
+ 'or correctly specified by the plugin\'s `require_jars` directive', :exception => ne.message, :backtrace => ne.backtrace)
107
+ fail(LogStash::PluginLoadingError, 'JMS Input failed to load, likely because a JMS provider was not available')
108
+ end
109
+
99
110
  @session = @connection.create_session()
100
111
 
101
112
  # Cache the producer since we should keep reusing this one.
102
113
  destination_key = @pub_sub ? :topic_name : :queue_name
103
114
  @producer = @session.create_producer(@session.create_destination(destination_key => @destination))
104
115
 
105
- if !@delivery_mode.nil?
106
- @producer.delivery_mode_sym = @deliver_mode
107
- end
116
+ # If a delivery mode has been specified, inform the producer
117
+ @producer.delivery_mode_sym = @delivery_mode.to_sym unless @delivery_mode.nil?
118
+
108
119
  end # def register
109
120
 
110
121
  def receive(event)
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-output-jms'
4
- s.version = '3.0.3'
4
+ s.version = '3.0.4'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Push events to a JMS topic or queue."
7
7
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -14,6 +14,7 @@ describe "outputs/jms" do
14
14
 
15
15
  context 'when initializing' do
16
16
  it "should register" do
17
+ pending('JMS Provider')
17
18
  output = LogStash::Plugin.lookup("output", "jms").new(jms_config)
18
19
  expect {output.register}.to_not raise_error
19
20
  end
@@ -26,6 +27,7 @@ describe "outputs/jms" do
26
27
 
27
28
  context 'when outputting messages' do
28
29
  it 'should send logstash event to jms queue' do
30
+ pending('JMS Provider')
29
31
  jms = LogStash::Outputs::Jms.new(jms_config)
30
32
  jms.register
31
33
  jms.receive(event)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-jms
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elasticsearch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-06 00:00:00.000000000 Z
11
+ date: 2018-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  requirements: []
127
127
  rubyforge_project:
128
- rubygems_version: 2.6.11
128
+ rubygems_version: 2.6.13
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: Push events to a JMS topic or queue.