Server process to monitor sync -gw updates

I java have a server side process that get invoked on every document update that goes through the sync gateway. The current implementation is a web hook.

The problem I have is if I take the server down temporarily (or there’s a problem like a network outage) it will miss some updates.

Is there a java API I can use to implement something like the Changes Worker Pattern mentioned here? Basically I want some sort of queue of work that can be fed by the sync gateway and processed by my server.

I’m not quite sure if you’re asking if there’s something that actually implements the CWP. I don’t believe there is. It’s pretty much just monitoring the changes feed, though.

To do this yourself, you have a few choices. You could use the Java version of Couchbase Lite, and replicate a channel. You can do the REST calls yourself. Or you can use the Swagger spec to generate a Java client for you (or see if there’s a Java Swagger implementation to use).

You can see a very simple version of monitoring the changes feed using Node + Swagger client in this blog post: https://blog.couchbase.com/2017/january/node.js-swagger-monitor-document-changes-couchbase-mobile