Skip to content

Commit

Permalink
Add withErrorHandler docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bzablocki committed Nov 12, 2024
1 parent f31a320 commit 4dddd33
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ public Write<T> withSubmissionMode(SubmissionMode submissionMode) {
* <p>The Solace writer can either use the JCSMP modes in streaming or batched.
*
* <p>In streaming mode, the publishing latency will be lower, but the throughput will also be
* lower. todo validate the constant sec
* lower.
*
* <p>With the batched mode, messages are accumulated until a batch size of 50 is reached, or
* {@link UnboundedBatchedSolaceWriter#ACKS_FLUSHING_INTERVAL_SECS} seconds have elapsed since
Expand Down Expand Up @@ -999,7 +999,15 @@ public Write<T> withSessionServiceFactory(SessionServiceFactory factory) {
return toBuilder().setSessionServiceFactory(factory).build();
}

/** todo docs */
/**
* An optional error handler for handling records that failed to publish to Solace.
*
* <p>If provided, this error handler will be invoked for each record that could not be
* successfully published. The error handler can implement custom logic for dealing with failed
* records, such as writing them to a dead-letter queue or logging them.
*
* <p>If no error handler is provided, failed records will be ignored.
*/
public Write<T> withErrorHandler(ErrorHandler<BadRecord, ?> errorHandler) {
return toBuilder().setErrorHandler(errorHandler).build();
}
Expand Down

0 comments on commit 4dddd33

Please sign in to comment.