Skip to content

fix(broker): change the call of broker.kick from send to send_and_wait#9

Merged
GefMar merged 1 commit into
taskiq-python:mainfrom
shihaoH:fix/change-broker-send-mode
Apr 28, 2026
Merged

fix(broker): change the call of broker.kick from send to send_and_wait#9
GefMar merged 1 commit into
taskiq-python:mainfrom
shihaoH:fix/change-broker-send-mode

Conversation

@shihaoH
Copy link
Copy Markdown

@shihaoH shihaoH commented Dec 26, 2025

Summary

  • Replace AIOKafkaProducer.send with send_and_wait inside AioKafkaBroker.kick.
  • Ensures the broker call completes only after the producer receives broker ack or raises (timeouts/auth/SSL), instead of silently succeeding after buffering.

Why

Currently kick uses send, which enqueues to the local buffer and returns immediately; transport-level failures are not propagated, so middlewares may mark messages as sent even when the broker rejected them. send_and_wait follows the aiokafka recommended pattern and surfaces real send outcomes.

Reference

aiokafka docs: https://aiokafka.readthedocs.io/en/stable/producer.html

fixes: #8

@GefMar GefMar merged commit c926e20 into taskiq-python:main Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Use send_and_wait in AioKafkaBroker.kick to surface producer errors and avoid false-positive sends

2 participants