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
-
I have created a folder and named it as "WASJMS" on my client machine and copied the following files from WebSphere to this folder.
com.ibm.ws.sib.client.thin.jms_8.5.0.jar
com.ibm.ws.orb_8.5.0.jar
com.ibm.ws.ejb.thinclient_8.5.0.jar
sas.client.props
ssl.client.props -
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)
keytool -v -importkeystore -srckeystore trust.p12 -destkeystore trust.jks -srcstoretype pkcs12 -deststoretype jks -srcstorepass WebAS -deststorepass WebAS_JKS -alias root2 -srckeypass WebAS -destkeypass WebAS_JKS
keytool -v -importkeystore -srckeystore key.p12 -destkeystore key.jks -srcstoretype pkcs12 -deststoretype jks -srcstorepass WebAS -deststorepass WebAS_JKS -alias default -srckeypass WebAS -destkeypass WebAS_JKS
Then I copied the new files (key.jks and trust.jks) to my client folder (WASJMS)
-
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.
-
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.
set SSL_RMI_DEFS= ^
-Dcom.ibm.SSL.ConfigURL="file:/C:/Users/ranieri/WASJMS/ssl.client.props" ^
-Dcom.ibm.CORBA.ConfigURL="file:/C:/Users/ranieri/WASJMS/sas.client.props"
set HERMES_OPTS=%HERMES_OPTS% %SSL_RMI_DEFS% -
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)
-
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:
binding: jms/RanieriConnectionFactory
initialContextFactory: com.ibm.websphere.naming.WsnInitialContextFactory
providerURL: iiop://bpm857:9810
Also, I have informed username and password fields, this is the WebSphere user and pass that has permission to read the queue.
- 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
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.