Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RabbitMQ Error while pushing a message to queue

I am trying to push a JSON message to the RabbitMQ queue using a message exchange. I have installed RabbitMQ through a docker.

I have create and started a docker container using the following:

docker run -d --hostname myrabbit --name rabbit-assignment -e RABBITMQ_DEFAULT_VHOST=/ -p 15672:15672
rabbitmq:3-management

Below is my application.properties

spring.rabbitmq.port = 15672
spring.rabbitmq.username = guest
spring.rabbitmq.password = guest
server.port = 9292
spring.rabbitmq.host=localhost
spring.rabbitmq.virtual-host=/

Below is the error:

2022-01-15 16:35:52.828 ERROR 44873 --- [nio-9292-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.amqp.AmqpIOException: java.io.IOException] with root cause

java.io.EOFException: null
    at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290) ~[na:1.8.0_181]
    at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:91) ~[amqp-client-5.13.1.jar:5.13.1]
    at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:184) ~[amqp-client-5.13.1.jar:5.13.1]
    at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:665) ~[amqp-client-5.13.1.jar:5.13.1]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_181]
like image 778
Utkarsh Avatar asked Mar 28 '26 16:03

Utkarsh


1 Answers


spring.rabbitmq.port = 15672
you're using 15672 as the port. This is only the UI/admin port.
The port for applications to use is 5672.

Just change that and you'll be running along.

BR,
~A

like image 144
anjanb Avatar answered Mar 31 '26 04:03

anjanb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!