ArgumentError when consuming a message with the jms plugin

Hello everyone,

I'am new to logstash and i've been trying to establish using the jms plugin a connection to a jboss queue and it worked, but whenever a message is been consumed instead of displaying it logstash throws this error :

jms ERROR An exception occurred processing Appender plain_console org.jruby.exceptions.ArgumentError: (ArgumentError) wrong number of arguments (given 0, expected 1)
at home.user.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.jruby_minus_jms_minus_1_dot_3_dot_0_minus_java.lib.jms.message.inspect(/home/user/logstash/vendor/bundle/jruby/2.5.0/gems/jruby-jms-1.3.0-java/lib/jms/message.rb:131)
at org.jruby.RubyHash.inspect(org/jruby/RubyHash.java:877)
at org.jruby.RubyHash.to_s(org/jruby/RubyHash.java:945)
at org.logstash.log.LoggerExt.error(org/logstash/log/LoggerExt.java:103)
at home.user.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_input_minus_jms_minus_3_dot_1_dot_2_minus_java.lib.logstash.inputs.jms.queue_event(/home/user/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jms-3.1.2-java/lib/logstash/inputs/jms.rb:298)
at home.user.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_input_minus_jms_minus_3_dot_1_dot_2_minus_java.lib.logstash.inputs.jms.run(/home/user/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jms-3.1.2-java/lib/logstash/inputs/jms.rb:235)
at home.user.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.jruby_minus_jms_minus_1_dot_3_dot_0_minus_java.lib.jms.message_consumer.each(/home/user/logstash/vendor/bundle/jruby/2.5.0/gems/jruby-jms-1.3.0-java/lib/jms/message_consumer.rb:70)
at home.user.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_input_minus_jms_minus_3_dot_1_dot_2_minus_java.lib.logstash.inputs.jms.run(/home/user/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jms-3.1.2-java/lib/logstash/inputs/jms.rb:234)
at home.user.logstash.logstash_minus_core.lib.logstash.java_pipeline.inputworker(/home/user/logstash/logstash-core/lib/logstash/java_pipeline.rb:322)
at home.user.logstash.logstash_minus_core.lib.logstash.java_pipeline.start_input(/home/user/logstash/logstash-core/lib/logstash/java_pipeline.rb:314)

i'm i doing something wrong here or is this a bug ?
Thank you for your help.

There is definitely a bug here. There is an exception being raised in the upstream jruby-jms library in JMS::Message#inspect (link), which means that when Logstash attempts to log an error message that includes the message, a failure happens.

It looks like the Implementation of JMS::ObjectMessage in that upstream library is broken, defining data(val) which requires an argument, stomping on the existing definition of that method that accepted zero arguments:

# Interface javax.jms.ObjectMessage
module JMS::ObjectMessage
  def data
    getObject
  end

  def data(val)
    setObject(val)
  end
end

-- reidmorrison/jruby-jms:lib/jms/object_message.rb@1680ef973

Unfortunately, it looks like the maintainer of that project has archived it, and is not actively maintaining it so we will need to find another way around it in our plugin that depends on it.

1 Like

@ghost_recon Are you trying to use ObjectMessage?

Per the docs, ObjectMessage is not supported in the JMS plugin at this time.

1 Like

yes i'm using ObjectMessage thank you so all i have to do is switch to TextMessage or BytesMessage is that it ?

@ghost_recon - yes, you can use a TextMessage, BytesMessage or MapMessage

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.