Skip to content

Bug: Event ack'd after calling KafkaMessage.nack with auto_commit=False #1001

Description

@bradydean

Describe the bug

Events are ack'd after calling nack().

How to reproduce

from faststream import FastStream, Logger
from faststream.kafka import KafkaMessage

broker = KafkaBroker()
app = FastStream(broker)

@broker.subscriber("test", group_id="async_subscriber", auto_commit=False)
async def async_subscriber(message: str, logger: Logger, msg: KafkaMessage):
    logger.info(message)
    await msg.nack()

Expected behavior

After publishing an event to the test topic, the message is logged and consumer does not ack the message.

Observed behavior
The message is logged and it appears the consumer acks the message. In kafka-ui I see the consumer group is 0 messages behind.

Environment

Running FastStream 0.2.15 with CPython 3.11.6 on Linux

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

AioKafkaIssues related to `faststream.kafka` modulebugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions