# Configuring logstash-input-jms plugin to read WebSphere JMS queue

**URL:** <https://discuss.elastic.co/t/configuring-logstash-input-jms-plugin-to-read-websphere-jms-queue/77490>\
**Category:** Logstash\
**Created:** [March 6, 2017, 11:31am UTC](https://discuss.elastic.co/t/configuring-logstash-input-jms-plugin-to-read-websphere-jms-queue/77490 "2017-03-06T11:31:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ranieri\_Mazili\_de\_Ol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ranieri_mazili_de_ol/32/15815_2.png) [@Ranieri\_Mazili\_de\_Ol](https://discuss.elastic.co/u/Ranieri_Mazili_de_Ol)\
**Post date:** [March 6, 2017, 11:31am UTC](https://discuss.elastic.co/t/configuring-logstash-input-jms-plugin-to-read-websphere-jms-queue/77490/1 "2017-03-06T11:31:11Z")

</div>

I'm trying to connect to a WebSphere JMS. I can connect to it using HermesJMS and below are the steps need to connect to my queue using HermesJMS and then what I tried to connection using logstash-plugin-jms. Please, I really need help to try to consume messages from this queue and couldn't find any documentation about it.

**Resumed steps to read messages from WebSphere JMS queue on HermesJMS**

1. I have created a folder and named it as "WASJMS" on my client machine and copied the following files from WebSphere to this folder.

2. On WebSphere I have key.p12 and trust.p12 files, which I have to convert to jks format so it can be used by Oracle JVM instead of IBM JVM (WebSphere Default JVM)

Then I copied the new files (key.jks and trust.jks) to my client folder (WASJMS)

1. Some changes was made on ssl.client.props and sas.client.props file to setup jks files path, passwords and set it to read SUN(Oracle) type.

2. Then, I changed hermes.bat file to use my ssl.client.props and sas.client.props on startup, pasting the following files before last line.

3. Then I opened HermesJMS, created a new session which I named as was855 and on providers tab I've created a new group (was855sib) and added all jars needed (the 3 jars files I mentioned in step 1)

 ![](https://us1.discourse-cdn.com/elastic/original/3X/e/7/e77d6cc632bc2ed463fb9bee2cd02a12f888c2e7.png)

1. Then, back in sessions tab I choose hermes.JNDIQueueConnectionFactory as class and choose was855sib to use their jars dependencies. After that, I've added 3 properties and set their values as below:

 ![](https://us1.discourse-cdn.com/elastic/original/3X/c/c/cc5bee638479d16c26d036d2682df0ae1d833b28.png)

1. That's all. After this setup all I needed to do is right click on the created session and choose "Discover" option, so it listed all JMS queues and could I choose my jms/RanieriQueue

 ![](https://us1.discourse-cdn.com/elastic/original/3X/a/a/aada44c0d0301be7de8c2f1d60cda8ed74dd3bf4.png)

That's it. I want to read the same queue (jms/RanieriQueue) using logstash-input-jms plugin and I've tried using the following configuration.

**logstash.conf**

```
input { 
    jms {
        yaml_file => "C:/Users/ranieri/Downloads/logstash-5.2.2/logstash-5.2.2/config/jms.yml"
        yaml_section => "websphere"
        include_header => true
        include_properties => true
        include_body => true
        use_jms_timestamp => false
        destination => "jms/RanieriQueue"
        interval => 3
        runner => async
    }
}
output {
    stdout { codec => rubydebug }
}

```

**jms.yml**

```
# JMS
websphere:
# Connect to a remote WebSphere JMS Queue
    :jndi_name: jms/RanieriConnectionFactory
    :jndi_context: 
    java.naming.factory.initial: com.ibm.websphere.naming.WsnInitialContextFactory
    java.naming.provider.url: iiop://bpm857:9810
    java.naming.factory.url.pkgs: com.ibm.ws.naming
    java.naming.security.principal: bpmadmin
    java.naming.security.credentials: bpmadmin
    :require_jars:
        - C:\Users\ranieri\WASJMS\com.ibm.ws.ejb.thinclient_8.5.0.jar
        - C:\Users\ranieri\WASJMS\com.ibm.ws.orb_8.5.0.jar
        - C:\Users\ranieri\WASJMS\com.ibm.ws.sib.client.thin.jms_8.5.0.jar

```

Also, I've changed setup.bat inside logstash-5.2.2/bin to load ssl.client.props and sas.client.props adding the following lines:

```
SET JAVA_OPTS=%JAVA_OPTS% -Dcom.ibm.SSL.ConfigURL=file:/C:/Users/ranieri/WASJMS/ssl.client.props
SET JAVA_OPTS=%JAVA_OPTS% -Dcom.ibm.CORBA.ConfigURL=file:/C:/Users/ranieri/WASJMS/sas.client.props

```

When I try to start logstash I'm receiving the following error message.

> 22:38:29.931 [[main]javax.jms.JMSSecurityException: CWSIA0006E: The authorization for the supplied user name was not successful., :backtrace=\>["com.ibm.ws.sib.api.jms.impl.JmsManagedConnectionFactoryImpl.createConnection(com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java:186)", "com.ibm.ws.sib.api.jms.impl.JmsManagedConnectionFactoryImpl.createConnection(com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java:138)", "java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)", "RUBY.initialize(C:/Users/ranieri/Downloads/logstash-5.2.2/logstash-5.2.2/vendor/bundle/jruby/1.9/gems/jruby-jms-1.2.0-java/lib/jms/connection.rb:204)", "RUBY.start(C:/Users/ranieri/Downloads/logstash-5.2.2/logstash-5.2.2/vendor/bundle/jruby/1.9/gems/jruby-jms-1.2.0-java/lib/jms/connection.rb:50)", "RUBY.run\_async(C:/Users/ranieri/Downloads/logstash-5.2.2/logstash-5.2.2/vendor/bundle/jruby/1.9/gems/logstash-input-jms-3.0.0-java/lib/logstash/inputs/jms.rb:226)", "RUBY.run(C:/Users/ranieri/Downloads/logstash-5.2.2/logstash-5.2.2/vendor/bundle/jruby/1.9/gems/logstash-input-jms-3.0.0-java/lib/logstash/inputs/jms.rb:257)", "RUBY.inputworker(C:/Users/ranieri/Downloads/logstash-5.2.2/logstash-5.2.2/logstash-core/lib/logstash/pipeline.rb:449)", "RUBY.start\_input(C:/Users/ranieri/Downloads/logstash-5.2.2/logstash-5.2.2/logstash-core/lib/logstash/pipeline.rb:443)", "java.lang.Thread.run(java/lang/Thread.java:745)"]}

Any ideas of where is my mistake? Thanks

P.S: I also have a java code that can connect to this queue and read the messages, let me know if you think java code can help you to understand where is the problem.

---

<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:** [April 3, 2017, 11:31am UTC](https://discuss.elastic.co/t/configuring-logstash-input-jms-plugin-to-read-websphere-jms-queue/77490/2 "2017-04-03T11:31:13Z")

</div>

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