RabbitMQ adapter 'Error creating a connection: null'

RabbitMQ adapter 'Error creating a connection: null'

book

Article ID: KB0072956

calendar_today

Updated On:

Products Versions
TIBCO Streaming 10.6 and later

Description

The following error is seen from the RabbitMQ adapter when trying to run a Streaming application:
2021-10-13 08:41:22.179000-0500 [9620:runtime [tid=7884]] ERROR Consumer: Action:
connect Object: com.rabbitmq.client.ConnectionFactory@4cd07a2d Message:
Error creating a connection: null
java.io.IOException: null
  at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:129)
  at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:125)
  ...
  Caused by: com.rabbitmq.client.ShutdownSignalException: connection error
  ...
  Caused by: java.io.EOFException: null

Issue/Introduction

Outlines the steps needed to resolve the RabbitMQ adapter message: 'Error creating a connection: null'.

Resolution

This error indicates that the RabbitMQ adapter's 'Host' configuration value is correct, and the RabbitMQ broker machine is listening on the 'Port' specified in the adapter configuration. However, this is not the correct broker port for the RabbitMQ service. In the above case, the adapter's 'Port' value was incorrectly set to the RabbitMQ management console port (rather than the broker port).

The correct broker port (which, by default, is 5672) may be confirmed using tools like nmap (on Linux) and PortQry (on Windows). For example:
$ nmap -p 1-65535 RabbitHost
Starting Nmap 7.80 ( https://nmap.org ) at 2021-10-13 15:55 EDT
Nmap scan report for RabbitHost (10.x.x.x)
Host is up (0.000052s latency).
Not shown: 65533 closed ports
PORT     STATE SERVICE
5672/tcp open  amqp
8080/tcp open  http-proxy
> portqry -n RabbitHost -r 5670:5680
Querying target system called:
 RabbitHost
Attempting to resolve name to IP address...
Name resolved to 10.x.x.x
querying...
TCP port 5670 (unknown service): NOT LISTENING
TCP port 5671 (unknown service): NOT LISTENING
TCP port 5672 (unknown service): LISTENING
TCP port 5673 (unknown service): NOT LISTENING
...
Here, we can see that the RabbitMQ broker machine ('RabbitHost') is listening on the expected broker port (5672).

Note that you should use a smaller search range when using PortQry on Windows, otherwise the query will take a very long time to complete.  You may also consult with your RabbitMQ administrator and request the RabbitMQ server log for more details.

 

Additional Information

For a working RabbitMQ adapter configuration example, refer to Knowledge article 000045323