The design overview diagram:
Records coming in for routing are processed in the following order (as also seen on the diagram):
- Rec is read from the incoming connection.
- Rec gets into the main queue.
- Re-write rules are applied.
- Routing rules are applied.
- Rec gets in host queue.
- Rec is sent out to the target.
The steps when the system is shut down:
- Get interrupt signal.
- Stop accepting incoming connections.
- Finish reading from already open connections.
- Close open connections.
- Empty main queue.
- Empty host queues.
- Close connections to hosts.
- Ack termination finish.
Please see here for the config documentation.