Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
Document current HTTP 207 handling
Browse files Browse the repository at this point in the history
  • Loading branch information
otrosien committed Sep 15, 2023
1 parent 1f982ee commit a5ed6fb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions fahrschein/src/main/java/org/zalando/fahrschein/NakadiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,22 @@ public List<Partition> getPartitions(String eventName) throws IOException {

/**
* Writes the given events to the endpoint provided by the eventName.
*
* In case of a partial success (or also in cases like validation errors, which are complete failures), Fahrschein
* will throw an EventPublishingException with the BatchItemResponses (as returned from Nakadi) for the failed
* items in the responses property.
* These objects have the eid of the failed event, a publishingStatus (failed/aborted/submitted - but these are
* filtered out)), the step where it failed and a detail string.
* If the application sets the eids itself (i.e. doesn't let Nakadi do it) and keeps track of them, this allows it
* to resend only the failed items later.
* It also allows differentiating between validation errors (which likely don't need to be retried, as they are
* unlikely to succeed the next time, unless the event type definition is changed) and publishing errors
* (which should be retried, possibly with some back-off).
*
* Recommendation: Implement a retry-with-backoff handler for {{EventPublishingException}}s, which, depending on
* your ordering consistency requirements, either retries the full batch, or retries the failed events based
* on the event-ids.
*
* @param eventName where the event should be written to
* @param events that should be written
* @param <T> Type of the Event
Expand Down

0 comments on commit a5ed6fb

Please sign in to comment.