Lists events for a given source identifier and source type. You can also specify a start and end time. For more
information on AWS DMS events, see Working with Events and Notifications
in the AWS Database Migration User Guide.
This is a variant of
#describeEvents(software.amazon.awssdk.services.databasemigration.model.DescribeEventsRequest) operation.
The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will
internally handle making service calls for you.
When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
failures only after you start streaming the data. The subscribe method should be called as a request to start
streaming data. For more info, see
org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber). Each call to the subscribe
method will result in a new
org.reactivestreams.Subscription i.e., a new contract to stream data from the
starting request.
The following are few ways to use the response class:
1) Using the subscribe helper method
software.amazon.awssdk.services.databasemigration.paginators.DescribeEventsPublisher publisher = client.describeEventsPaginator(request);CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
future.get();
}
2) Using a custom subscriber
software.amazon.awssdk.services.databasemigration.paginators.DescribeEventsPublisher publisher = client.describeEventsPaginator(request);public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
public void onNext(software.amazon.awssdk.services.databasemigration.model.DescribeEventsResponse response) { //... };
});}
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
Note: If you prefer to have control on service calls, use the
#describeEvents(software.amazon.awssdk.services.databasemigration.model.DescribeEventsRequest)operation.