# Logstash not working with ActiveMQ

**URL:** <https://discuss.elastic.co/t/logstash-not-working-with-activemq/252022>\
**Category:** Logstash\
**Created:** [October 14, 2020, 10:46am UTC](https://discuss.elastic.co/t/logstash-not-working-with-activemq/252022 "2020-10-14T10:46:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaushik.vankayala](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@kaushik.vankayala](https://discuss.elastic.co/u/kaushik.vankayala)\
**Post date:** [October 14, 2020, 10:46am UTC](https://discuss.elastic.co/t/logstash-not-working-with-activemq/252022/1 "2020-10-14T10:46:58Z")

</div>

I am trying to consume a message from an ActiveMQ with the following configuration;

```
input
{
	jms
	{
        broker_url => 'failover:(ssl://b-d5bc797b-sjd8-41d2-dfjh7-127ba48c6238-1.mq.eu-west-1.amazonaws.com:61617)?initialReconnectDelay=100'		
        destination => 'activemq-log4j2-configuration' 
        factory => 'org.apache.activemq.ActiveMQConnectionFactory' 
        pub_sub => false 
        use_jms_timestamp => false
        # JMS provider credentials if needed 
        username => 'user'
        password => 'pass'
        # Parts of the JMS message to be included 
        include_header => false
        include_properties => false
        include_body => true
        factory_settings => { exclusive_consumer => true }
        # Jar Files to include
        require_jars => ['C:\Users\M1045583\Desktop\activemq-all-5.15.12.jar'] 
	}
}
output
{
	#stdout { codec => line { format => "%{message}"} }
	stdout { codec => "rubydebug" }
}

```

The error i am facing is;

```
C:\Program Files\logstash-6.3.2-windows-x86_64\bin>logstash -f "C:\Users\M1045583\Desktop\activemq_consume.conf"
Sending Logstash's logs to C:/Program Files/logstash-6.3.2-windows-x86_64/logs which is now configured via log4j2.properties
[2020-10-14T14:03:27,167][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2020-10-14T14:03:27,872][INFO][logstash.runner] Starting Logstash {"logstash.version"=>"6.3.2"}
[2020-10-14T14:03:33,065][INFO][logstash.pipeline] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50}
[2020-10-14T14:03:33,397][INFO][logstash.pipeline] Pipeline started successfully {:pipeline_id=>"main", :thread=>"#<Thread:0x219ba705 run>"}
[2020-10-14T14:03:33,550][INFO][logstash.agent] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[2020-10-14T14:03:34,051][WARN][logstash.inputs.jms] JMS Consumer Died {:exception=>"TypeError", :exception_message=>"cannot convert instance of class org.jruby.RubyString to boolean", :backtrace=>["C:/Program Files/logstash-6.3.2-windows-x86_64/vendor/bundle/jruby/2.3.0/gems/jruby-jms-1.3.0-java/lib/jms/connection.rb:193:in `block in initialize'", "org/jruby/RubyHash.java:1343:in `each'", "C:/Program Files/logstash-6.3.2-windows-x86_64/vendor/bundle/jruby/2.3.0/gems/jruby-jms-1.3.0-java/lib/jms/connection.rb:188:in `initialize'", "C:/Program Files/logstash-6.3.2-windows-x86_64/vendor/bundle/jruby/2.3.0/gems/logstash-input-jms-3.1.2-java/lib/logstash/inputs/jms.rb:225:in `run'", "C:/Program Files/logstash-6.3.2-windows-x86_64/logstash-core/lib/logstash/pipeline.rb:512:in `inputworker'", "C:/Program Files/logstash-6.3.2-windows-x86_64/logstash-core/lib/logstash/pipeline.rb:505:in `block in start_input'"]}
[2020-10-14T14:03:34,105][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=>9600}
[2020-10-14T14:03:36,360][WARN][logstash.runner] SIGINT received. Shutting down.
[2020-10-14T14:03:39,086][WARN][logstash.inputs.jms] JMS Consumer Died {:exception=>"TypeError", :exception_message=>"cannot convert instance of class org.jruby.RubyString to boolean", :backtrace=>["C:/Program Files/logstash-6.3.2-windows-x86_64/vendor/bundle/jruby/2.3.0/gems/jruby-jms-1.3.0-java/lib/jms/connection.rb:193:in `block in initialize'", "org/jruby/RubyHash.java:1343:in `each'", "C:/Program Files/logstash-6.3.2-windows-x86_64/vendor/bundle/jruby/2.3.0/gems/jruby-jms-1.3.0-java/lib/jms/connection.rb:188:in `initialize'", "C:/Program Files/logstash-6.3.2-windows-x86_64/vendor/bundle/jruby/2.3.0/gems/logstash-input-jms-3.1.2-java/lib/logstash/inputs/jms.rb:225:in `run'", "C:/Program Files/logstash-6.3.2-windows-x86_64/logstash-core/lib/logstash/pipeline.rb:512:in `inputworker'", "C:/Program Files/logstash-6.3.2-windows-x86_64/logstash-core/lib/logstash/pipeline.rb:505:in `block in start_input'"]}
[2020-10-14T14:03:39,275][INFO][logstash.pipeline] Pipeline has terminated {:pipeline_id=>"main", :thread=>"#<Thread:0x219ba705 run>"}
Terminate batch job (Y/N)? Y

```

I have only a simple message as Hello World in the ActiveMQ that created manually from Send option of ActiveMQ instance only

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/d/fdda0a4d5553cc7bbdcca3f5b33759ec820fcfa4.png)

Any help please?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [October 14, 2020, 2:53pm UTC](https://discuss.elastic.co/t/logstash-not-working-with-activemq/252022/2 "2020-10-14T14:53:21Z")

</div>

Can you try commenting out the factory\_settings option of the input?

---

<div class="post-metadata">

**Author:** ![kaushik.vankayala](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@kaushik.vankayala](https://discuss.elastic.co/u/kaushik.vankayala)\
**Post date:** [October 14, 2020, 4:02pm UTC](https://discuss.elastic.co/t/logstash-not-working-with-activemq/252022/3 "2020-10-14T16:02:14Z")

</div>

Worked like a charm. 🙂 What was the hint for you to understand the issue? I am intrigued to know the approach used 😉

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [October 14, 2020, 4:19pm UTC](https://discuss.elastic.co/t/logstash-not-working-with-activemq/252022/4 "2020-10-14T16:19:39Z")

</div>

> [@kaushik.vankayala](#):
>
> `backtrace=>["C:/Program Files/logstash-6.3.2-windows-x86_64/vendor/bundle/jruby/2.3.0/gems/jruby-jms-1.3.0-java/lib/jms/connection.rb:193:in `block in initialize'"`

That backtrace points at [this](https://github.com/reidmorrison/jruby-jms/blob/1680ef9737959da7794a1dc4d112afec14f7036a/lib/jms/connection.rb#L193) line of code, which appears to be tweaking settings on the connection factory, so getting rid of the factory\_settings looked like it might avoid going through that code path.

---

<div class="post-metadata">

**Author:** ![CMBagnall](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@CMBagnall](https://discuss.elastic.co/u/CMBagnall)\
**Post date:** [October 28, 2020, 5:22pm UTC](https://discuss.elastic.co/t/logstash-not-working-with-activemq/252022/5 "2020-10-28T17:22:53Z")

</div>

Hi all,

I have a similar issue trying to set the watchTopicAdvisories parameter to false in the factory\_settings. Unfortunately, commenting this section out is not an option as I need this parameter set. The exact configuration line in the jms input plug-in section which is causing the problem is:

`factory_settings => { watchTopicAdvisories => false }`

Any suggestions on what I am doing wrong or alternate ways of setting this parameter?

[edit] I am currently using Logstash version 7.7.0.

Thanks!  
Chris

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 25, 2020, 5:22pm UTC](https://discuss.elastic.co/t/logstash-not-working-with-activemq/252022/6 "2020-11-25T17:22:54Z")

</div>

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