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: Idempotent consumer #2683

Closed
iluwatar opened this issue Oct 15, 2023 · 4 comments · Fixed by #3082
Closed

Microservice pattern: Idempotent consumer #2683

iluwatar opened this issue Oct 15, 2023 · 4 comments · Fixed by #3082

Comments

@iluwatar
Copy link
Owner

iluwatar commented Oct 15, 2023

Description:
The Idempotent Customer design pattern is essential in microservices architectures to ensure that repeated processing of the same request does not produce different outcomes. This pattern helps in avoiding duplicate operations in distributed systems where network issues or retries might cause the same request to be sent multiple times.

Main Elements of the Pattern:

  1. Unique Request Identifier: Assign a unique identifier to each request to track and manage its state.
  2. Request Storage: Store the request data and its state to check for duplicates.
  3. State Management: Implement mechanisms to manage the state of requests (e.g., pending, processing, completed) and to handle retries gracefully.
  4. Response Handling: Ensure that the same response is returned for repeated requests, preventing inconsistent outcomes.
  5. Concurrency Control: Use locking mechanisms or transactional processes to manage concurrent requests and ensure data integrity.

References:

Acceptance Criteria:

  1. Implement a unique request identifier mechanism for the Idempotent Customer design pattern.
  2. Develop a request storage and state management system to handle and track the state of requests.
  3. Ensure that repeated requests return consistent responses and implement concurrency control mechanisms to maintain data integrity.
@mm-saiful6854
Copy link
Contributor

Hi, Could you assign me for contributing.

Copy link

stale bot commented Apr 12, 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 Apr 12, 2024
@iluwatar iluwatar moved this from In Progress to Todo in Java Design Patterns project Apr 12, 2024
@iluwatar iluwatar removed the status: stale issues and pull requests that have not had recent interaction label Apr 12, 2024
@dmgodoy
Copy link
Contributor

dmgodoy commented Nov 2, 2024

Hi @iluwatar. I'd like to work on this one.

@dmgodoy
Copy link
Contributor

dmgodoy commented Nov 3, 2024

Just submitted a pull request, looking forward to your feedback.

Kind regards,

David.

iluwatar pushed a commit that referenced this issue Nov 11, 2024
* added idempotent consumer pattern

* updated doc

* fixed bug in RequestService

* add test converage

* Add test converage to state machine

* renamed module and added code example
@github-project-automation github-project-automation bot moved this from In Progress to Done in Java Design Patterns project Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants