简体   繁体   中英

Java solution for meteor DDP server

I have a web application that reflects the content of a list from my server. To do that I use websockets (socket.io) to listen to update messages from my server.

After having a good first snapshot of the list, it receives update events like {'action':'changed','type': 'typeA', 'id':1} , then the page can make a request to http://server.com/api/typeA/1 and insert, delete or replace the updated item in the model.

The problem is, if any update event occur while my websocket connection is being stablished the system will lose those and be delayed. Or if it requests the first snapshot after the connection event happens, the request may complete after some update is signaled and then the new value may be replaced by an ancient one.

Is there some lib to make what Meteor DDP does for publishing a generic DB in a server written in java?

We came across many distributed data mechanisms and ended up choosing a data sync strategy using deepstream.io that implements the features that we wanted for cloning a collection from the server by sending updates on demand, and have a good and well supported framework for JS and Java.

It worths giving it a try.

Please take a look over: https://github.com/Reactive-Extensions/RxJS

I think this is what you're looking for.

Thank you, Alex S.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM