Class TailableCursorRequest<T>

java.lang.Object
org.springframework.data.mongodb.core.messaging.TailableCursorRequest<T>
All Implemented Interfaces:
SubscriptionRequest<org.bson.Document,T,SubscriptionRequest.RequestOptions>

public class TailableCursorRequest<T> extends Object implements SubscriptionRequest<org.bson.Document,T,SubscriptionRequest.RequestOptions>
SubscriptionRequest implementation to be used to listen to query results in a Capped Collection using a Tailable Cursor.
The most trivial use case is subscribing to all events of a specific collection.
 
     TailableCursorRequest<Document> request = new TailableCursorRequest<>(System.out::println, () -> "collection-name");
 
 
TailableCursorRequest.TailableCursorRequestBuilder offers a fluent API for creating TailableCursorRequest with TailableCursorRequest.TailableCursorRequestOptions in one go.
   
       TailableCursorRequest<Document> request = TailableCursorRequest.builder()
           .collection("collection-name")
           .publishTo(System.out::println)
           .build();
   
 
Since:
2.1
Author:
Christoph Strobl, Mark Paluch