# \[Logstash jms input\] Unable to connect to ActiveMQ topic

**URL:** <https://discuss.elastic.co/t/logstash-jms-input-unable-to-connect-to-activemq-topic/115170>\
**Category:** Logstash\
**Created:** [January 11, 2018, 8:22pm UTC](https://discuss.elastic.co/t/logstash-jms-input-unable-to-connect-to-activemq-topic/115170 "2018-01-11T20:22:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pavel\_Sapozhnikov](https://avatars.discourse-cdn.com/v4/letter/p/f475e1/32.png) [@Pavel\_Sapozhnikov](https://discuss.elastic.co/u/Pavel_Sapozhnikov)\
**Post date:** [January 11, 2018, 8:22pm UTC](https://discuss.elastic.co/t/logstash-jms-input-unable-to-connect-to-activemq-topic/115170/1 "2018-01-11T20:22:52Z")

</div>

Hi

I am trying to connect to an ActiveMQ topic using `logstash-jms-input` plugin and I am unable to. When I run logstash it will create a queue with the name that I give it in destination but never a topic. Here are my config files:

```auto
input { 
      #stdin { } 
      http { port => 31311 }
      jms {
        yaml_file => "/usr/share/logstash/jms.yml"
        yaml_section => "activemq"
        destination => "RVR"
      }
} 
output {
       elasticsearch { hosts => ["localhost:9200"] }
       stdout { codec => rubydebug }
}

```

and yaml

```auto
activemq:
  :broker_url: tcp://152.122.20.30:61616
  :pub_sub: true
  :runner: consumer
  :factory: org.apache.activemq.ActiveMQConnectionFactory
  :require_jars:
    - /usr/share/logstash/activemq-all-5.11.1.jar

```

What this apparently does is it will create a Queue named RVR if one doesn't already exists. I thought that by specifying `pub_sub: true` the plugin would know to connect to a topic instead.

When I send the message through the ActiveMQ console I get: `"jms_destination": "queue://RVR",`

I feel like I am missing a key part here being able to specify a topic and not a queue and seems like pub\_sub flag doesn't really accomplish that.

Could anyone help out here? Do I need to basically fix the plugin to do that?

---

<div class="post-metadata">

**Author:** ![simmel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simmel/32/48040_2.png) [@simmel](https://discuss.elastic.co/u/simmel)\
**Post date:** [January 17, 2018, 3:13pm UTC](https://discuss.elastic.co/t/logstash-jms-input-unable-to-connect-to-activemq-topic/115170/2 "2018-01-17T15:13:41Z")

</div>

Does using `topic://RVR` as `destination` work?

```auto
input {
      #stdin { }
      http { port => 31311 }
      jms {
        yaml_file => "/usr/share/logstash/jms.yml"
        yaml_section => "activemq"
        destination => "topic://RVR"
      }
}

```

---

<div class="post-metadata">

**Author:** ![Pavel\_Sapozhnikov](https://avatars.discourse-cdn.com/v4/letter/p/f475e1/32.png) [@Pavel\_Sapozhnikov](https://discuss.elastic.co/u/Pavel_Sapozhnikov)\
**Post date:** [January 17, 2018, 3:26pm UTC](https://discuss.elastic.co/t/logstash-jms-input-unable-to-connect-to-activemq-topic/115170/3 "2018-01-17T15:26:19Z")

</div>

No unfortunately. I tried that what it does is just creates a topic with this name, as in `topic://RVR`

---

<div class="post-metadata">

**Author:** ![simmel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simmel/32/48040_2.png) [@simmel](https://discuss.elastic.co/u/simmel)\
**Post date:** [January 18, 2018, 9:53am UTC](https://discuss.elastic.co/t/logstash-jms-input-unable-to-connect-to-activemq-topic/115170/4 "2018-01-18T09:53:53Z")

</div>

Ah, right. I read the code now and I see that you need to use the  
`pub_sub` setting to specify topic vs queue.

You are using `pub_sub` in the yml config though and it should be in the  
logstash configuration:

```auto
input {
      […]
      jms {
        yaml_file => "/usr/share/logstash/jms.yml"
        yaml_section => "activemq"
        destination => "RVR"
        pub_sub => true
      }
}

```

---

<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:** [February 15, 2018, 9:54am UTC](https://discuss.elastic.co/t/logstash-jms-input-unable-to-connect-to-activemq-topic/115170/5 "2018-02-15T09:54:02Z")

</div>

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