Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8888/user-microservice/default": Connection refused #2768

Open
Medlhnin opened this issue Feb 27, 2025 · 0 comments

Comments

@Medlhnin
Copy link

Medlhnin commented Feb 27, 2025

My user-service config client failed to load configuration from config-service. Initially, I thought the issue was with the config-service, but when I tested it using curl http://localhost:8888/user-microservice/default, it successfully returned data. The problem only occurs when using Docker Compose, whereas everything works fine when running directly in the IDE. Could you provide some insights to help resolve this?

Also, the configurations for both user-service and book-service are stored in a remote repository accessible from config-service server.

That's docker-compose.file:

version: "3.9"
services:
  config-service:
    build: ./ConfigServer
    container_name: config-service
    ports:
      - "8888:8888"
    environment:
      - GIT_USERNAME=${GIT_USERNAME}
      - GIT_PASSWORD=${GIT_PASSWORD}
    networks:
      - library-network

  discovery-service:
    build: ./EurekaServer
    container_name: discovery-service
    ports:
      - "8761:8761"
    depends_on:
      - config-service
    networks:
      - library-network

  gateway-service:
    build: ./API_Gateway
    container_name: gateway-service
    ports:
      - "8090:8090"
    depends_on:
      - discovery-service
    networks:
      - library-network

  user-service:
    build: ./user-microservice
    container_name: user-service
    ports:
      - "8081:8081"
    depends_on:
      - discovery-service
      - config-service
    networks:
      - library-network

  book-service:
    build: ./book-microservice
    container_name: book-service
    ports:
      - "8082:8082"
    depends_on:
      - discovery-service
    networks:
      - library-network

networks:
  library-network:
    driver: bridge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants