Wednesday, July 12, 2023

RabbitMQ: Caused by: com.rabbitmq.client.ShutdownSignalException: connection error, java.io.IOException, Caused by: java.io.EOFException


>PROBLEM


Attempt to connect to RabbitMQ returns the following:


java.io.IOException

at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:129)

at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:125)

at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:396)

...

Caused by: com.rabbitmq.client.ShutdownSignalException: connection error

...

Caused by: java.io.EOFException

at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290)

...

Caused by: com.rabbitmq.client.ShutdownSignalException: connection error

...

Caused by: java.io.EOFException

at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290)

...

java.io.IOException

at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:129)

at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:125)

at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:396)

...

Caused by: com.rabbitmq.client.ShutdownSignalException: connection error

Caused by: java.io.EOFException

at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290)

...



>SOLUTION


Check the following:

1.Usually, the console management uses 15672 port.

2. Usually, the HTTP request via app (web service/microserve) uses 5672

3. Make sure to enable these ports when working with container (docker).

4. Avoid using /api  on a RESTful web service because "/api" is already used by the native rabbitmq's ws,



An example of the properties file (application.yml):

  rabbit-host: mydomain.com 

  rabbit-port: 5672

  rabbit-ssl: false

  rabbit-user: john doe

  rabbit-pass: secret


>ENV

RabbitMQ v3.7.8
Erlang v21.2.6
Java 17

No comments:

Post a Comment

eclipse: java: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" or Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

  >PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...