spring-cloud/spring-cloud-commons

support for local discoveryclient

ashraf-revo opened this issue · 6 comments

adding support for local discoveryclient like and unlike eureka or consul which provide discovery for registered service using another external server

we can provide those service and the instances using configuration like this

spring:
  cloud:
    local:
      discovery:
        services:
          user:
            - url: "http://localhost:8081"
              metadata:
                service-name: user
                instance: user-1
            - url: "http://localhost:8082"
              metadata:
                service-name: user
                instance: user-2

use cases

  1. for local dev when you don't need to run heavily service-registey service and wait your service to be health and register itself to this service-registey service
  2. for production use cases when your microservices don't implement service-registry register pattern to register itself to the service-registery and want to use the benefit of load balancing
  3. for integration test when you need to test your microservice to microservice call , you can use testcontainers to create the another microservice to you (one or more instance ) and communicate with it and also use loadbalancer with it

i already implemented a cloud starter to do this here https://github.com/ashraf-revo/spring-cloud-local

yes it looks what I actually I implemented but also
Do you think we need another one for reactive applications @ryanjbaxter

Do you think we need another one for reactive applications

Are there specific things you think will not work?

@ryanjbaxter I think there is a case iam not sure I was running spring cloud gateway and webclient and webclient use reactiveclient discovery

There is also a SimpleReactiveDiscoveryClient implementation, so I think that should work

yes thanks this should help me