sync gateway webhook issue

21 views
Skip to first unread message

Gaurav Joshi

unread,
Apr 4, 2016, 11:41:45 AM4/4/16
to Couchbase Mobile
Hello,

I am trying to implement webhooks to call REST service API on document change event.
When document is changed I get following WARNING in Sync gateway console and REST service specified is not getting called.

2016-03-31T13:06:46.320-05:00 WARNING: changeCache: Error unmarshaling doc "21st
_amendment_brewery_cafe": <nil> -- db.(*changeCache).DocChanged.func1() at chang
e_cache.go:327

Is there any specific way I need to write REST call method in Java ?
Let me know what is missing or wrong here.
I would Appreciate quick help.


Here is my sync gateway config file :

{
"interface": ":4984",
"adminInterface": ":4985",
"log": ["CRUD", "CRUD+", "HTTP", "HTTP+", "Access", "Cache", "Shadow", "Shadow+", "Changes", "Changes+"],
"databases": { 
"sync_gateway": {
"server": "http://localhost:8091",
"bucket": "beer-sample",
"verbose": "false",
"sync":`function(doc) {channel(doc.channels);}`,
"users": {
"GUEST": {
"disabled": false,
"admin_channels": ["*"]
}
}, 
  "event_handlers": {
  "document_changed": [
    {
   "handler": "webhook",
   "url": "http://localhost:8080/demo/notify",
   "filter": `function(doc) {
    if (doc.type == 'brewary') {
     return true;
    }
    return false;
   }`
    }
  ]
   }
}
}
}
Reply all
Reply to author
Forward
0 new messages