# Logstash JMS Input Plugin Failing to Connect to Broker URL (tcp://localhost:7222)

**URL:** <https://discuss.elastic.co/t/logstash-jms-input-plugin-failing-to-connect-to-broker-url-tcp-localhost-7222/371771>\
**Category:** Logstash\
**Created:** [December 10, 2024, 2:28pm UTC](https://discuss.elastic.co/t/logstash-jms-input-plugin-failing-to-connect-to-broker-url-tcp-localhost-7222/371771 "2024-12-10T14:28:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Loredana](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@Loredana](https://discuss.elastic.co/u/Loredana)\
**Post date:** [December 10, 2024, 2:28pm UTC](https://discuss.elastic.co/t/logstash-jms-input-plugin-failing-to-connect-to-broker-url-tcp-localhost-7222/371771/1 "2024-12-10T14:28:05Z")

</div>

Hi,

We are using the _Logstash JMS input plugin_ to read events from a JMS Queue and send them to Elasticsearch. However, we are encountering a strange issue where Logstash tries to connect to a default URL (_tcp://localhost:7222)_, even though we have configured a different broker URL in the _broker\_url_ parameter.

**Preliminary Information:**  
Logstash version: 8.1.2  
JMS Input Plugin version: 3.2.2  
Java version: 11.0.14.1 (bundled with Logstash)  
JMS Queue: TIBCO JMS Queue XA

**Logstash Pipeline Configuration:**

```auto
input {
   jms {
      broker_url => 'tcp://<BROKER_IP>:<BROKER_PORT>'
      destination => '<QUEUE_NAME>'
      factory => 'com.tibco.tibjms.TibjmsXAQueueConnectionFactory'
      pub_sub => false
      use_jms_timestamp => false
      username => '<USER>'
      password => '<PASSWORD>'
      include_headers => true
      include_properties => true
      include_body => true
      require_jars => ['/opt/logstash/lib-new/jms-2.0.jar', '/opt/logstash/lib-new/tibjms.jar','/opt/logstash/lib-new/tibjmsadmin.jar','/opt/logstash/lib-new/tibjmsapps.jar', '/opt/logstash/lib-new/tibjmsufo.jar','/opt/logstash/lib-new/tibrvjms.jar']
   }
}

filter {
   # No filters applied
}

output {
   elasticsearch {
      hosts => ["<HOST_1>","<HOST_2>","<HOST_3>"]
      index => "index-%{+YYYY.MM.dd}"
      user => '<USER>'
      password => '<PASSWORD>'
      cacert => "/opt/logstash/config/certs/cacerts.cer"
      ssl_certificate_verification => false
      manage_template => false
   }
}

```

Despite specifying the correct broker URL (tcp://\<BROKER\_IP\>:\<BROKER\_PORT\>), Logstash attempts to connect to the default URL (tcp://localhost:7222).

Below is the relevant error from the Logstash logs:

```auto
[WARN][logstash.inputs.jms][main][2b5afb8005c295ef273c2ff514d41ffe77af3775b65d55449ded1991c9a479c0] JMS Consumer Died {:exception=>"Java::JavaxJms::JMSException", :exception_message=>"Failed to connect to the server at tcp://localhost: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:1419)", "com.tibco.tibjms.TibjmsConnection.<init>(com/tibco/tibjms/TibjmsConnection.java:4412)", "com.tibco.tibjms.TibjmsQueueConnection.<init>(com/tibco/tibjms/TibjmsQueueConnection.java:39)", "com.tibco.tibjms.TibjmsxCFImpl._createImpl(com/tibco/tibjms/TibjmsxCFImpl.java:175)", "com.tibco.tibjms.TibjmsxCFImpl._createConnection(com/tibco/tibjms/TibjmsxCFImpl.java:255)", "com.tibco.tibjms.TibjmsXAConnectionFactory.createConnection(com/tibco/tibjms/TibjmsXAConnectionFactory.java:102)", "jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)", "jdk.internal.reflect.NativeMethodAccessorImpl.invoke(jdk/internal/reflect/NativeMethodAccessorImpl.java:62)", "java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:566)", "org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:471)", "org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:329)", "opt.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.jruby_minus_jms_minus_1_dot_3_dot_0_minus_java.lib.jms.connection.initialize(/opt/logstash/vendor/bundle/jruby/2.5.0/gems/jruby-jms-1.3.0-java/lib/jms/connection.rb:202)", "org.jruby.RubyClass.newInstance(org/jruby/RubyClass.java:939)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(org/jruby/RubyClass$INVOKER$i$newInstance.gen)", "opt.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_input_minus_jms_minus_3_dot_2_dot_1_minus_java.lib.logstash.inputs.jms.run(/opt/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jms-3.2.1-java/lib/logstash/inputs/jms.rb:269)", "opt.logstash.logstash_minus_core.lib.logstash.java_pipeline.inputworker(/opt/logstash/logstash-core/lib/logstash/java_pipeline.rb:409)", "opt.logstash.logstash_minus_core.lib.logstash.java_pipeline.start_input(/opt/logstash/logstash-core/lib/logstash/java_pipeline.rb:400)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:318)", "java.lang.Thread.run(java/lang/Thread.java:829)"]}

```

**Additional Information:**  
Other external applications, using the same connection type (non-JNDI), are able to connect successfully to the same JMS queue without any issues. This suggests that the problem may be specific to the Logstash JMS input plugin.

**Troubleshooting Steps Taken:**  
During troubleshooting, we also enabled Debug mode in Logstash to ensure that the correct broker\_url is being read from the configuration file.  
In Debug mode, the expected _broker\_url_ was confirmed to be loaded correctly. Despite this, Logstash still attempts to connect to the default URL (`tcp://localhost:7222`).

We've tried both configuring the connection parameters entirely in the Logstash configuration file and using a separate YAML file, as suggested in the Logstash documentation. However, the issue persists in both cases.

Any suggestions or insights into resolving this issue would be greatly appreciated.

Thank you in advance!

Loredana

---

<div class="post-metadata">

**Author:** ![Ellouze\_Farouk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ellouze_farouk/32/122902_2.png) [@Ellouze\_Farouk](https://discuss.elastic.co/u/Ellouze_Farouk)\
**Post date:** [April 28, 2025, 1:00pm UTC](https://discuss.elastic.co/t/logstash-jms-input-plugin-failing-to-connect-to-broker-url-tcp-localhost-7222/371771/2 "2025-04-28T13:00:32Z")

</div>

Hello,  
Did you manage to find a solution for this? I'm facing the same problem
