regarding document updates notification
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?
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("http://10.0.0.9:8091/pools");
List uris = new LinkedList();
TapClient tapClient = new TapClient(uris, "default", "");
TapStream op = tapClient.tapBackfill("tapClient", 0, TimeUnit.SECONDS);
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.
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