RabbitMQ spring boot application seeing "org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused" error after migrating from Java 8 to Java 17.
search cancel

RabbitMQ spring boot application seeing "org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused" error after migrating from Java 8 to Java 17.

book

Article ID: 409403

calendar_today

Updated On:

Products

VMware Tanzu Platform - Cloud Foundry

Issue/Introduction

RabbitMQ spring boot application using Java 8 migrated to Java 17 began seeing the following error when attempting to connect with the RabbitMQ service:

2025-09-02T15:15:52.360-05:00 [APP/PROC/WEB/1] [OUT] {"@timestamp":"2025-09-02T15:15:52.359-05:00","xlogz":"Rabbit health check failed","severity":"WARN","class":"org.springframework.boot.actuate.amqp.RabbitHealthIndicator","service":"document-creation-app","StackTrace":"org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused

Resolution

Steps taken to resolve the issue in this instance:

1) Stop the application.

2) Unbind RabbitMQ and delete the service.

3) Recreate the RabbitMQ service.

4) Bind the application.

5) Redeploy code.