Uploaded image for project: 'Couchbase Documentation'
  1. Couchbase Documentation
  2. DOC-10217

Document the winning_rev_only document_changed webook option

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • None
    • sync-gateway
    • None

    Description

      In SG 2.8.1 and later we added an opt-in config option to only fire the document_changed webhook event handler when the document being changed is the winning revision.

       

      This avoids webhook spam when resolving conflicts by removing old non-winning revisions of documents.

      Note: Setting this still allows for duplicate revisions to be sent to a webhook URL, if a previously winning revision is made the winner again (after tombstoning the current winning revision/branch). Clients still need to ensure they have appropriate handling for duplicate events.

       

      https://docs.couchbase.com/sync-gateway/current/configuration-schema-database.html#event_handlers

      https://docs.couchbase.com/sync-gateway/current/webhooks.html
       

      Example of this in use in a SG database config:

      {    
          "bucket": "b1",
          "num_index_replicas": 0,
          "event_handlers": {
              "document_changed": [
                  {
                      "handler": "webhook",
                      "url": "http://127.0.0.1:49571?event=WinningRevChanged",
                      "options": {
                          "winning_rev_only": true
                      }
                  }
              ]
          }
      }
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              elliot.hunter Elliot Hunter
              ben.brooks Ben Brooks
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty