How to capture events in Cassandra?

Asked by At

We have an application say Application A which pushes a list of tasks to Application B and at the same time makes an entry into cassandra. The cassandra schema looks like this :-

class Task{

     @PrimaryKeyColumn(type=Partitioned)
     String batchId;

     @PrimaryKeyColumn(type=Clustered)
     String taskId;

     Boolean success;

     String operation;

     String error;
}

Now Application B starts processing each of these tasks and keeps updating Application A. Only once all the tasks inside a single batch reach a success/failure state. We need to update Application C

Initially we thought of keeping the entire data in memory and updating the status as soon as we receive response, but it was too heavy for the heap to manage and also if the service goes down the list of tasks are also lost.

If there could be a way in Cassandra to capture a stream of events or Cassandra notifying the application each time an update happens to any of those records then we could use a CountdownLatch and the moment the Countdownlatch completes we could trigger a notification to Application C.

0 Answers