if the validation microservice receives the message, validates the user but can't send the answer back due to the messaging platform failure, the validation microservice also retries sending the message at some later time.suppose the messaging platform fails, then the user microservice tries to send the message again at some later time, for example, by scheduled batch-processing of all users that were not yet validated.if the validation microservice is not accessible, then the messaging platform with its persistent queue functionality ensures that the validation microservice would receive this message at some later time.The last step, when the user microservice removes the invalid account, is a compensation phase. However, for some period of time, the user entity appeared to be in an incomplete state. if the results are negative, the user microservice deletes the user accountĪfter we've gone through all these steps, the system should be in a consistent state.if the results are positive, the user microservice unblocks the user.the validation microservice runs the background check and sends a message to the user microservice with the results of the check.the user microservice sends a message to the validation microservice to do the background check of a user.a confirmation of registration is sent to the user with a warning that not all functionality of the system is accessible right away.It could signify that this user hasn't yet been validated and doesn't have access to full system functionality the user microservice marks this user with a flag.the user microservice registers a user, saving information about her in its local database.In this architecture, a happy scenario would be: Notice that we don't refer to the entity User from the entity Message, as the user classes aren't accessible from the message microservice. Private long long String Instant messageTimestamp Įach microservice has its own database. It encapsulates the entity Message and everything around it: class Message implements Serializable = GenerationType.AUTO) The message microservice would be concerned with broadcasting. Private long String String Instant lastMessageTime The user microservice would be concerned with the user profile (creating a new user, editing profile data etc.) with the following underlying domain class: class User implements Serializable = GenerationType.AUTO) If we could split our system in such microservices, there's a good chance we wouldn't need to implement transactions between them at all.įor example, let's consider a system of broadcast messaging between users.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |