Routing Slip
The Routing Slip integration pattern will allow our application to route a message through a series of processing steps consecutively even when the order of the steps is not well-known at design time and could vary for each message. This implementation is a 2-step process; first, we can attach a routing slip to each message that will specify the correct sequence of steps, second, wrap each component with a message router that reads the routing slip and routes the message to the next component in the sequence.
The processing of every message will have inserted a special component at the beginning of the process that will determine the exact list of required steps for each message. Then, it will attach the list (known as a routing slip) to the message and it will start the processing sequence by routing the message to the first step. After successful processing, each step will review the Routing Slip and pass the message to the next step specified in the routing table.