Open aleskovets opened 8 years ago
A Tibco EMS client indeed needs a username and password for JNDI lookup unless anonymous logins are allowed (see EMS documentation).
Theoretically the jndi username/password doesn't need to be the same as the JMS client username/password (but in practice it is in most cases). Personally I believe that 2 new config parameters jndi_username and jndi_password would be more correct. That would also reflect a yaml configuration.
A workaround can be achieved by using a yaml for the connection parameters and use the logstash config only for the configuration of your destination.
Example
# File 1: The logstash configuration, pub_sub should be set to true when subscribing on a topic
input {
jms {
include_header => true
include_properties => true
include_body => true
use_jms_timestamp => true
timeout => -1
destination => "q.logstash.command"
pub_sub => false
yaml_file => "/opt/app/logstash/config/ems.yml"
yaml_section => "ems"
}
}
output { ... }
# File 2: /opt/app/logstash/config/ems.yml
ems:
:username: admin
:password: admin
:jndi_name: ConnectionFactory
:jndi_context:
java.naming.factory.initial: com.tibco.tibjms.naming.TibjmsInitialContextFactory
java.naming.provider.url: tcp://localhost:7222
java.naming.security.principal: admin
java.naming.security.credentials: admin
:require_jars:
- /opt/app/logstash/config/libs-ems/jms-2.0.jar
- /opt/app/logstash/config/libs-ems/tibjms.jar
- /opt/app/logstash/config/libs-ems/tibcrypt.jar
Hi,
I have used the same configuration but getting following error. Could you please help?
][main][78b0cd62e58d9956aee9af1f0dad237438a87cead6d53972bd702a7515f4af7e] JMS Consumer Died {:exception=>"Java::JavaxJms::JMSException", :exception_message=>"Failed to connect to the server at tcp://innolx133105:7222", :backtrace=>["com.tibco.tibjms.TibjmsxLinkTcp._createSocket(com/tibco/tibjms/TibjmsxLinkTcp.java:823)", "com.tibco.tibjms.TibjmsxLinkTcp.connect(com/tibco/tibjms/TibjmsxLinkTcp.java:914)", "com.tibco.tibjms.TibjmsConnection._create(com/tibco/tibjms/TibjmsConnection.java:1359)", "com.tibco.tibjms.TibjmsConnection.
Hi!
Is there any specific reason why username and password is not passed to jms_config in jndi lookup was chosen? I am trying to integrate this plugin with the Tibco EMS and it seems like Tibco's Connection Manager expects username/password passed for Connection creation even if java.naming.security.principal and java.naming.security.credentials were presented during the lookup.
If jms_config block is reconfigured like below everything works just fine:
Is it possible to pass username and password to jms_config even if jndi lookup was chosen?