Solve the java.net.connectexception: connection rejected: connect error

Add the following to the application.yml configuration file:

eureka:
  client:
    register-with-eureka: false
    fetch-registry: false

Read More: