Regarding document updates notification

Hi All,

We have a requirement to track all document updates of a particular bucket. But because of the rate at which the documents are updating and the number of documents in the bucket we have to avoid the usage of views for this.

We can make use of JAVA TAP API for this but the information available on this looks very limited, can some one please assist me to get more information on this?

Any help on this would be greatly appreciated?



What do you want to do when a document has been modified?

Can you do that from the Client API? for example wrapped the Couchbase SDK and capture the update here. Today Couchbase server does not allow you to capture event on the server, mainly to be sure that “custom code” will not impact global performance.

Yes you can use the TAP approach but may be hard to register all subscribed to all keyss


You could have a look at this thread :

We had the same requirement, but didn’t find our way out to a good solution

The good news is that : "In fact we are in the process of updating the TAP protocol and in the future plan to have a changes feed that could be directly consumed "

Many thanks for the information provided Tug and Maxv. I’m able to configure an TAPClient to a Couchbase server bucket and receiving the update notifications from the same. Below is the piece of Java code i have written:

    URI base = new URI("");
    List<URI> uris = new LinkedList<URI>();
    TapClient tapClient = new TapClient(uris, "default", "");
    TapStream op = tapClient.tapBackfill("tapClient", 0, TimeUnit.SECONDS);
    while (tapClient.hasMoreMessages()) 
        ResponseMessage response = tapClient.getNextMessage();

        if (response != null) 
            System.out.println("UpdatedKey : "+response.getKey() );

This piece of code is working fine if we have single node in the cluster but if we have two nodes in a cluster it is giving duplicate messages i.e i’m receiving the updates for twice for the mutation of single document. Is this expected behavior of TAP protocol if we have multiple nodes configured in a cluster? If so is there a way to getaway with this problem and receive only one message per mutation?

Kindly share your views on this.


I need to have the implementation in which all the other bucket users will get the notification as soon as any document is updated in the bucket in Couchbase 5.0.1 version. Can that be done using Java?

Vishal Khandelwal