Distributed message forwarding method

The invention discloses a distributed message forwarding method, and belongs to the field of data interaction service. The method realizes configuration synchronization and state management between forwarding servers through a distributed management tool Zookeeper, each forwarding server is taken as a node of a Zookeeper cluster, each forwarding server node monitors states of other forwarding servers, and when the states of other forwarding server nodes are changed, tasks are redistributed to the changed forwarding servers through a load balancing algorithm. Compared to the prior art, the method provided by the invention provides a subscription/publishing function and realizes need-based customization of messages; the forwarding servers are main/standby servers relative to each other so that it is ensured that normal operation of service is not affected when any one forwarding server breaks down; forwarding failure messages are stored persistently so that data security is guaranteed; and conditional serialization caching is performed on high-coherence batch data so that service operation stability is guaranteed.