Interface PojoIndexingQueueEventSendingPlan
public interface PojoIndexingQueueEventSendingPlan
A set of indexing events to be sent to an external queue.
The external queue will be consumed by a background process which will then perform the indexing operations asynchronously.
-
Method Summary
Modifier and TypeMethodDescriptionvoidappend(String entityName, Object identifier, String serializedId, PojoIndexingQueueEventPayload payload) Appends an event to the plan, to be sentlaterand ultimately added to aPojoIndexingQueueEventProcessingPlan.voiddiscard()Discards all events that were added to this plan, without sending them.sendAndReport(OperationSubmitter operationSubmitter) Sends the events to the queue.
-
Method Details
-
append
void append(String entityName, Object identifier, String serializedId, PojoIndexingQueueEventPayload payload) Appends an event to the plan, to be sentlaterand ultimately added to aPojoIndexingQueueEventProcessingPlan.- Parameters:
entityName- The name of the entity type.identifier- The non-serialized entity identifier, to report sending errors.serializedId- The serialized entity identifier.payload- A payload to be forwarded as-is to the processing plan.- See Also:
-
discard
void discard()Discards all events that were added to this plan, without sending them. -
sendAndReport
CompletableFuture<MultiEntityOperationExecutionReport> sendAndReport(OperationSubmitter operationSubmitter) Sends the events to the queue.When the returned future completes, events are guaranteed to be stored in secure storage in such a way that they will eventually be processed.
- Parameters:
operationSubmitter- How to handle request to submit operation when the queue is full.- Returns:
- A
CompletableFuturethat will hold an execution report when all the events are sent. If sending an event failed, the future will be completed normally, but the report will contain an exception.
-