How to ensure message consistency?

find a related topic https://discuss.libp2p.io/t/gossipsub-message-ordering-and-consensus/2240.

First, let me detail my question. I have a local app which installed at several devices (A/B/C/D). I want to implement a feature where any changes made on any device will be synchronized to other devices . If any of the devices A/B/C/D leaves the P2P network, it should synchronize the changes made on other devices when it rejoins the network. It’s similar to a message queue (MQ), but it’s a decentralized MQ.

Is it possible to achieve that? Could anyone give some advice?