Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding exception logging for consumer's batch processing loop #78

Merged
merged 7 commits into from
Sep 8, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ The `Unreleased` section name is replaced by the expected version of next releas
## [Unreleased]

### Added

- Added a logging for exception caught in the batch processing loop. Any uncaught exception from the handler will be logged here as well.

### Changed
### Removed
### Fixed
Expand Down
1 change: 1 addition & 0 deletions src/FsKafka/FsKafka.fs
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ module private ConsumerImpl =
let batchSize = batch |> Array.sumBy approximateMessageBytes
counter.Delta(-batchSize)
with e ->
log.Information("Exception occurred while processing a batch - {exception}: {message}", e.GetType().FullName, e.Message)
bartelink marked this conversation as resolved.
Show resolved Hide resolved
tcs.TrySetException e |> ignore
cts.Cancel()
return! loop() }
Expand Down