When my Couchbase Server or the SyncGateway down

59 views
Skip to first unread message

Dumidu Madushanka

unread,
Feb 23, 2016, 11:38:47 PM2/23/16
to Couchbase Mobile


What is the mechanism use by Couchbase Lite to identify Couchbase Server and SyncGateway is working properly before it sends data into the Couchbase Server ?

Jens Alfke

unread,
Feb 24, 2016, 1:04:29 PM2/24/16
to mobile-c...@googlegroups.com

On Feb 23, 2016, at 8:38 PM, Dumidu Madushanka <dumi...@gmail.com> wrote:

What is the mechanism use by Couchbase Lite to identify Couchbase Server and SyncGateway is working properly before it sends data into the Couchbase Server ?

It doesn’t explicitly test. The replication is done by a series of REST calls to the server, and if the server isn’t up those will fail. Depending on the error, the replicator will assume the server’s unavailable.

—Jens

Dumidu Madushanka

unread,
Feb 24, 2016, 11:25:50 PM2/24/16
to Couchbase Mobile
Thanks for the quick reply. If we have use an another web service which is listen to the webhook, Is there a way to determine that layer's availability right before sync with Couchbase server ? If so, From where I can ping and determine that layer availability before perform the sync.

Jens Alfke

unread,
Feb 25, 2016, 12:55:42 PM2/25/16
to mobile-c...@googlegroups.com

On Feb 24, 2016, at 8:25 PM, Dumidu Madushanka <dumi...@gmail.com> wrote:

Thanks for the quick reply. If we have use an another web service which is listen to the webhook, Is there a way to determine that layer's availability right before sync with Couchbase server ? 

Sure. Have your web service respond to HTTP requests on a public address, and add code to your app to send such a request before it starts a sync. The response (or error) can tell the app whether your service is up.

—Jens

Dumidu Madushanka

unread,
Feb 26, 2016, 12:28:29 AM2/26/16
to Couchbase Mobile
The issue is we can not find the extract point which it starts the sync process after going online. Can you tell me the exact point I can ping my web service before it start the sync.

Jens Alfke

unread,
Feb 26, 2016, 12:42:27 AM2/26/16
to mobile-c...@googlegroups.com

On Feb 25, 2016, at 9:28 PM, Dumidu Madushanka <dumi...@gmail.com> wrote:

The issue is we can not find the extract point which it starts the sync process after going online. Can you tell me the exact point I can ping my web service before it start the sync.

There’s no hook to get control before that. I’m not sure exactly what you’re trying to do. If you don’t want clients to sync when your service is unavailable, you could configure something on the client side to block requests to the Sync Gateway. But having the app try to check for this seems like the wrong way to go about it.

—Jens

Jens Alfke

unread,
Feb 26, 2016, 12:48:51 AM2/26/16
to mobile-c...@googlegroups.com

On Feb 25, 2016, at 9:42 PM, Jens Alfke <je...@couchbase.com> wrote:

There’s no hook to get control before that. I’m not sure exactly what you’re trying to do. If you don’t want clients to sync when your service is unavailable, you could configure something on the client side to block requests to the Sync Gateway.

Sorry, I meant “configure something on the server side”.

—Jens

Dumidu Madushanka

unread,
Feb 26, 2016, 12:52:07 AM2/26/16
to Couchbase Mobile
okay. got the point. :)
Reply all
Reply to author
Forward
0 new messages