[Logstash jms input] Unable to connect to ActiveMQ topic

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:

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

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?

Does using topic://RVR as destination work?

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

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

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:

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

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