Package dev.dokimos.server.client
Class DokimosServerReporter.Builder
java.lang.Object
dev.dokimos.server.client.DokimosServerReporter.Builder
- Enclosing class:
DokimosServerReporter
Builder for
DokimosServerReporter.-
Method Summary
Modifier and TypeMethodDescriptionBearer API key for authentication.apiVersion(String apiVersion) API version, e.g.build()onItemDeliveryFailure(Consumer<DokimosServerReporter.ItemDeliveryFailure> onItemDeliveryFailure) Callback invoked when a batch of items is permanently dropped after all delivery retries.projectName(String projectName) Project name on the server.Dokimos server URL, e.g.spoolDirectory(Path spoolDirectory) Opt-in durable spool directory.
-
Method Details
-
serverUrl
Dokimos server URL, e.g."https://api.my-domain.com". -
projectName
Project name on the server. -
apiVersion
API version, e.g."v1". Defaults toDokimosServerReporter.DEFAULT_API_VERSION. -
apiKey
Bearer API key for authentication. -
onItemDeliveryFailure
public DokimosServerReporter.Builder onItemDeliveryFailure(Consumer<DokimosServerReporter.ItemDeliveryFailure> onItemDeliveryFailure) Callback invoked when a batch of items is permanently dropped after all delivery retries. The callback runs on the reporter's background worker thread, so keep it lightweight and do NOT callflush(),close(), orreportItem(...)on this reporter from it; doing so re-enters the worker and stalls delivery. Exceptions thrown by the callback are caught and logged. -
spoolDirectory
Opt-in durable spool directory. When set, permanently-failed item batches are appended as JSON lines tofailed-items.ndjsonin this directory so a transient outage past all retries does not silently lose data. Defaults tonull(disabled). -
build
- Throws:
IllegalStateException- ifserverUrlorprojectNameis not set.
-