# Is JMS output even possible?

**URL:** <https://discuss.elastic.co/t/is-jms-output-even-possible/53177>\
**Category:** Logstash\
**Created:** [June 17, 2016, 5:18pm UTC](https://discuss.elastic.co/t/is-jms-output-even-possible/53177 "2016-06-17T17:18:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pjoyce](https://avatars.discourse-cdn.com/v4/letter/p/8e7dd6/32.png) [@pjoyce](https://discuss.elastic.co/u/pjoyce)\
**Post date:** [June 17, 2016, 5:18pm UTC](https://discuss.elastic.co/t/is-jms-output-even-possible/53177/1 "2016-06-17T17:18:37Z")

</div>

I'm hoping someone here can provide just a basic example of using the logstash-output-jms plugin for logstash. The site itself has no info and I can find no config examples for output anywhere. Is this a valid plugin ?  
I just need to write messages to an activeMQ queue. I have tried the stomp output but that writes blank messages. Any suggestions ?

---

<div class="post-metadata">

**Author:** ![val](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/val/32/138203_2.png) [@val](https://discuss.elastic.co/u/val)\
**Post date:** [June 17, 2016, 5:20pm UTC](https://discuss.elastic.co/t/is-jms-output-even-possible/53177/2 "2016-06-17T17:20:56Z")

</div>

The `stomp` output (with `host`, `port` and `destination`) is the way to go. With ActiveMQ you need to start your broker with [stomp enabled](http://activemq.apache.org/stomp.html) (I guess you have otherwise you'd have connections issues)

Can you provide your current Logstash config and maybe a sample event that you're sending?

---

<div class="post-metadata">

**Author:** ![pjoyce](https://avatars.discourse-cdn.com/v4/letter/p/8e7dd6/32.png) [@pjoyce](https://discuss.elastic.co/u/pjoyce)\
**Post date:** [June 17, 2016, 6:53pm UTC](https://discuss.elastic.co/t/is-jms-output-even-possible/53177/3 "2016-06-17T18:53:08Z")

</div>

Thank you for your prompt reply.

I had tried the stomp output first but I got only empty message bodies. After some googling it looked like I needed to set a header value - "amq-msg-type" =\> "text". Problem is that a pull request to merge that feature in the stomp plugin was denied the previous day.

Looking through the JMS output src and underlying jruby I got it working so below is an example for any other folks looking. It actually turned out to be a simple config.  
The commented lines are what did not work from the given example at the top of the src.

from output in logstash conf file:  
jms {  
#include\_header =\> false  
#include\_properties =\> false  
#include\_body =\> true  
#use\_jms\_timestamp =\> false  
yaml\_file =\> "/usr/local/logstash/conf.d/jms.yml"  
#queue\_name =\> "outputstomp"  
destination =\> "outputstomp"  
pub\_sub =\> false  
yaml\_section =\> "activemq"  
}

```
YAML file:
# Active MQ Centralized Broker
activemq:
  :factory: org.apache.activemq.ActiveMQConnectionFactory
  :broker_url: tcp://127.0.0.1:61616
  :username: admin
  :password: xxxxx
  :require_jars:
    - /usr/local/activemq/activemq-all-5.10.0.jar
    - /usr/local/activemq/lib/optional/log4j-1.2.17.jar
```

---

<div class="post-metadata">

**Author:** ![val](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/val/32/138203_2.png) [@val](https://discuss.elastic.co/u/val)\
**Post date:** [June 17, 2016, 8:16pm UTC](https://discuss.elastic.co/t/is-jms-output-even-possible/53177/4 "2016-06-17T20:16:22Z")

</div>

The pull request was denied because message headers have been [included in another pull request](https://github.com/logstash-plugins/logstash-output-stomp/pull/9) two days ago.

Since then a new version of the `stomp` output [was released (2.0.5)](https://github.com/logstash-plugins/logstash-output-stomp/releases/tag/v2.0.5) with headers support. You should uninstall/reinstall the `logstash-output-stomp` plugin and it will work.

---

<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:** [July 6, 2017, 4:52am UTC](https://discuss.elastic.co/t/is-jms-output-even-possible/53177/5 "2017-07-06T04:52:08Z")

</div>


