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

fix(kafka sink): retry messages that result in kafka policy violations #22041

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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.d/22026-retry-kafka-policy-violations.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Retry Kafka messages that error with a policy violation so messages are not lost.

authors: PriceHiller
7 changes: 5 additions & 2 deletions src/sinks/kafka/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,12 @@ impl Service<KafkaRequest> for KafkaService {
})
.map_err(|(err, _)| err);
}
// Producer queue is full.
// Producer queue is full or a policy has been violated and the request should
// be retried
Err((
KafkaError::MessageProduction(RDKafkaErrorCode::QueueFull),
KafkaError::MessageProduction(
RDKafkaErrorCode::QueueFull | RDKafkaErrorCode::PolicyViolation,
),
original_record,
)) => {
if blocked_state.is_none() {
Expand Down
Loading