iluwatar / java-design-patterns

Design patterns implemented in Java
https://java-design-patterns.com
Other
88.28k stars 26.19k forks source link

Microservice pattern: Client-side service discovery #2685

Open iluwatar opened 8 months ago

iluwatar commented 8 months ago

Description: The Client-Side Service Discovery pattern is a design strategy in microservice architectures where the client is responsible for determining the network location of service instances. This involves querying a service registry, which keeps track of available service instances. The client retrieves the required information and selects an appropriate service instance to communicate with.

Main elements of the pattern include:

References:

  1. Microservices Patterns
  2. Spring Cloud Netflix Eureka
  3. Project Contribution Guidelines

Acceptance Criteria:

  1. Implement a service registry that can register and deregister service instances.
  2. Create a client module that can query the service registry to discover service instances.
  3. Ensure that the client module includes a basic load-balancing mechanism to distribute requests among multiple service instances.
lokytech5 commented 8 months ago

hello am from MLHhackathon open soucre week. can you assign me this

lokytech5 commented 8 months ago

thanks for this, am jumping on it right away

lokytech5 commented 8 months ago

I want to ask if can i use Spring Boot to implement the pattern as specified in the documentation just to be sure am on track. thanks

iluwatar commented 8 months ago

Yes, Spring Boot is perfectly fine. It has been used in some of the other patterns as well.

lokytech5 commented 8 months ago

Hello, I just completed the task assigned to me. How do you suggest I create a PR because each microservices has its own folder? e.g. service-registry has its own folder directory, likewise the rest of the microservices I created. I was thinking if I could add all the microservice folders in a single folder, initialize git, and add a readme.Md file along with it and create a PR. I don't know if this suggestion is okay. please let me know which to follow. thanks

iluwatar commented 8 months ago

I think we could follow the approach taken in aggregator-microservices, see https://github.com/iluwatar/java-design-patterns/tree/master/aggregator-microservices

lokytech5 commented 8 months ago

Good day, @iluwatar. I hope you are doing well. Is there any article or guide I can follow on configuring the microservice parent pom.xml since I am following a similar pattern?[https://github.com/iluwatar/java-design-patterns/tree/master/aggregator-microservices]. I could configure it but could not run it on my laptop. thanks

stale[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. The issue will be unassigned if no further activity occurs. Thank you for your contributions.