Sync Gateway Windows service

We have an phonegap application where the device need to work offline. But when there is connectivity CBlite syncs data with Couchbase server.

We are not migrating all our backend servers to No SQL and we need to be able to post data to legacy webservices that talks to SQL server when the CBlite sync happens (data moves from device to couchbase) based on some identifiers in the json.

Is there a way we could intercept this process and make rest webservice calls so the completed information can be posted to sql server for other workflow process.
Or should we write some retry attempts within phonegap app itself to make sure the webservice calls are made explicitly.

may be you can use webhooks.

Thank you, I am looking at webhooks documentation and came across this example
"document_changed": [
{
“handler”: “webhook”,
“url”: “http://localhost:8000/invitecode”,
“filter”: function(doc) { if (doc.type == "profile" && doc.invite_code) { return true; } return false; }
}

If we need to filter out based on type and call an external webservice that needs some data to be posted as a json how can we do that.

url would be " ipaddress:8080/PostDispositionService" for example, but where can we pass the data that the service needs?

webhook example FYI

Thank you for suggesting webhooks, We have implemented it. Is there a way to have retries in webhooks if the intial post fails?