Java api for Tap Message backfill is not working

I'm trying to use the tap message api to do online back up for couchbase. The backfill api seems useful because when the backup program stoped, it can be resumed from the stop time using backfill. I tried the following code:

    RequestMessage msg = null;
    MessageBuilder builder = new MessageBuilder();
 
    builder.doBackfill((Calendar.getInstance().getTimeInMillis() - (30 * 24 * 3600 * 1000)));
    msg = builder.getMessage();
    tapClient.tapCustom("noname", msg);   
 
    while (tapClient.hasMoreMessages()) {
      ResponseMessage responseMsg = tapClient.getNextMessage();
 
      if (responseMsg == null) {
        System.out.println("Nothing dumped for last second");
        continue;
      }
      System.out.println( "key:" + responseMsg.getKey() +
          "\nvalue:" + new String(responseMsg.getValue()) + "\nvbucket:" + responseMsg.getVbucket() );
    }
 
    tapClient.shutdown();

I thought this will give all the data set in last 30 days. However, it only gives the mutations set after the program is started.

Is there anything I did wrong ?

Couchbase server version is 2.0.0
Java sdk is 1.1.5 .

1 Answer

« Back to question.

In the current implementation of Couchbase Server, backfill from a particular datetime is not supported. You can either start from the beginning of time and then get all of the data as it changes, or you can get new data as it arrives by specifying a future date. Specific dates aren't supported based on the current Couchbase Cluster's capabilities.

We'll be looking to enhance this in the future.