Systems and methods for dynamic stateful message for stateless orchestration
A system and method for stateless orchestration and stateful message is provided. A message can be received by an orchestrator. The orchestrator can determine a list of microservices the message requires to execute the transaction based on a type of the message. The orchestrator can sequentially execute one or more microservices in the list of microservices, wherein each time a microservice is executed results of the execution are added to the message to create the stateful message.
1 . A method for stateless orchestration and stateful message, the method comprising:
receiving, by an orchestrator of a processor, an initial message indicating a transaction and a message type;
determining, by the orchestrator of the processor, an ordered processing path including the initial message by retrieving, from memory, a configuration record based on the message type, the configuration record indicating a list of microservices the message requires to execute the transaction based on a type of the message and the order of execution for the list of microservices;
creating, by the processor, a first stateful message by adding the ordered processing path to the initial message;
sequentially executing, by the orchestrator of the processor, at least two microservices in the list of microservices in accordance with the ordered processing path, wherein each time a microservice is executed results of the execution are automatically appended to the first stateful message to create a second stateful message, wherein the each appended result is input to the next microservice executed, and wherein the orchestrator refrains from storing results of the execution external to the second stateful message;
upon failure of one or more microservices in the list of microservice, automatically reverting, by the processor, to a prior microservice that was successful and continuing execution along the ordered processing path until either the list of microservices is completed or a maximum number of retries is met using a retry counter that is stored and updated in the second stateful message; and
creating a final stateful message based on the second stateful message and any retries.
2 . The method of claim 1 further comprising adding details about the message and the list of microservices to the message.
3 . The method of claim 2 wherein the details include a classification of the message, type of the transaction, identifier or any combination thereof.
4 . The method of claim 1 wherein the results of the execution include whether the microservice completed, time of the execution, retry count, error codes or any combination thereof.
5 . The method of claim 1 wherein determining the list of microservices further comprises retrieving lookup table from memory.
6 . A system for stateless orchestration and stateful message, the system comprising:
a memory; and
a processor including an orchestrator configured to:
receiving an initial message indicating a transaction and a message type;
determining an ordered processing path including the initial message by retrieving, from memory, a configuration record based on the message type, the configuration record indicating a list of microservices the message requires to execute the transaction based on a type of the message and the order of execution for the list of microservices;
sequentially executing at least two microservices in the list of microservices according to the ordered processing path, wherein each time a microservice is executed results of the execution are automatically appended to the first stateful message to create a second stateful message, wherein the each appended result is input to the next microservice executed, and wherein the orchestrator refrains from storing results of the execution external to the second stateful message;
upon failure of one or more microservices in the list of microservice, automatically revert, by the processor, to a prior microservice that was successful and continuing execution along the ordered processing path until either the list of microservices is completed or a maximum number of retries is met using a retry counter that is stored and updated in the second stateful message; and
create a final stateful message based on the second stateful message and any retries.
7 . The system of claim 6 wherein the orchestrator is further configured to add details about the message and the list of microservices to the message.
8 . The system of claim 7 wherein the details include a classification of the message, type of the transaction, identifier or any combination thereof.
9 . The system of claim 6 wherein the results of the execution include whether the microservice completed, time of the execution, retry count, error codes or any combination thereof.
10 . The system of claim 6 wherein determine the list of microservices further comprises retrieving lookup table from memory.