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

Microservice pattern: Self registration #2687

Open
iluwatar opened this issue Oct 15, 2023 · 6 comments
Open

Microservice pattern: Self registration #2687

iluwatar opened this issue Oct 15, 2023 · 6 comments
Assignees
Labels
epic: pattern status: stale issues and pull requests that have not had recent interaction type: feature

Comments

@iluwatar
Copy link
Owner

iluwatar commented Oct 15, 2023

Description:

The Microservices - Self Registration design pattern enables microservices to dynamically register themselves with a central registry when they start. This pattern is crucial for managing microservices in a dynamic environment where services can be added, removed, or updated frequently. By implementing this pattern, microservices become discoverable by other services, which allows for better scalability, resilience, and flexibility within the system.

Main Elements of the Pattern:

  1. Service Registry: A central repository that holds information about all available microservices.
  2. Service Instance: The actual microservices that need to register themselves with the service registry.
  3. Heartbeat Mechanism: A periodic check to ensure that registered services are still available and healthy.
  4. Discovery Client: A component that other microservices use to find and interact with the registered services.

Key Components to Implement:

  1. Service Registry Implementation: Set up a central registry using tools like Eureka, Consul, or Zookeeper.
  2. Service Registration: Code within each microservice to register itself with the central registry upon startup.
  3. Heartbeat/Health Check: Mechanism to ensure continuous availability and health status reporting of the services.
  4. Service Discovery Client: Implementation to enable other services to discover and communicate with registered services.

References:

Acceptance Criteria:

  1. Service Registry Setup:
    • A central service registry must be configured and running (e.g., Eureka, Consul, Zookeeper).
  2. Microservice Registration:
    • Each microservice must automatically register itself with the central registry upon startup.
  3. Health Check Mechanism:
    • A heartbeat or health check mechanism must be implemented to monitor the health of registered services.
  4. Service Discovery:
    • Other microservices must be able to discover and communicate with registered services using a discovery client.
  5. Documentation:
    • Comprehensive documentation must be provided, including setup instructions, code examples, and usage guidelines.
@Pat-r1ck
Copy link

Hi, can you assign me this one?

@Pat-r1ck
Copy link

just to clarify, I just have to design a microservice that has a discovery server and other services that meet the following criteria:

  • Service instances must be registered with the service registry on startup and unregistered on shutdown
  • Service instances that crash must be unregistered from the service registry
  • Service instances that are running but incapable of handling requests must be unregistered from the service registry

am I correct?

@iluwatar
Copy link
Owner Author

Yeah, look at the solution chapter for some implementation tips

Copy link

stale bot commented Jan 24, 2024

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.

@stale stale bot added the status: stale issues and pull requests that have not had recent interaction label Jan 24, 2024
@stale stale bot removed the status: stale issues and pull requests that have not had recent interaction label Jul 8, 2024
@iluwatar iluwatar added info: help wanted status: stale issues and pull requests that have not had recent interaction labels Jul 8, 2024
@stale stale bot removed the status: stale issues and pull requests that have not had recent interaction label Jul 8, 2024
@iluwatar iluwatar moved this from In Progress to Todo in Java Design Patterns project Jul 8, 2024
@BahaBoualii
Copy link

@iluwatar can I start working on this one?

@iluwatar iluwatar assigned iluwatar and BahaBoualii and unassigned iluwatar Oct 13, 2024
@iluwatar iluwatar moved this from Todo to In Progress in Java Design Patterns project Oct 13, 2024
Copy link

stale bot commented Dec 13, 2024

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.

@stale stale bot added the status: stale issues and pull requests that have not had recent interaction label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic: pattern status: stale issues and pull requests that have not had recent interaction type: feature
Projects
Status: In Progress
Development

No branches or pull requests

3 participants