public class QueuedSender extends EventSender
EventSender that uses a persistent queue to save and forward messages.
During send, a push to the queue is done. A separate thread batches and forwards the messages to foxtrot.
If push fails, it will keep on retrying. check the constructors for different options. This sender allows for setting a
lower-level sender like HttpSyncEventSender to send the events to the API.
If no sender is set, it creates an HttpSyncEventSender to send messages.| Constructor and Description |
|---|
QueuedSender(EventSender eventSender,
EventSerializationHandler serializationHandler,
String path,
int batchSize)
Instantiates a new Queued sender.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
send(Document document) |
void |
send(List<Document> documents) |
void |
send(String table,
Document document) |
void |
send(String table,
List<Document> documents) |
getSerializationHandlerpublic QueuedSender(EventSender eventSender, EventSerializationHandler serializationHandler, String path, int batchSize) throws Exception
eventSender - Set a sender like HttpSyncEventSender.path - The path to the queue file.batchSize - The size of the batch to be sent per API call.Exception - the exceptionpublic void send(Document document) throws Exception
send in class EventSenderExceptionpublic void send(String table, Document document) throws Exception
send in class EventSenderExceptionpublic void send(List<Document> documents) throws Exception
send in class EventSenderExceptionpublic void send(String table, List<Document> documents) throws Exception
send in class EventSenderExceptionpublic void close()
throws Exception
close in class EventSenderExceptionCopyright © 2020. All rights reserved.