Skip to content

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

Open
shihaoH wants to merge 1 commit intotaskiq-python:mainfrom
shihaoH:fix/change-broker-send-mode
Open

fix(broker): change the call of broker.kick from send to send_and_wait#9
shihaoH wants to merge 1 commit intotaskiq-python:mainfrom
shihaoH:fix/change-broker-send-mode

Conversation

@shihaoH
Copy link

@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

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

1 participant