Skip to content

Using store_offset with OwnedMessage #368

Closed
@bruceg

Description

@bruceg

I would like to use the Consumer::store_offset interface to update the offset asynchronously after a message has been fully processed. Currently, this interface takes a BorrowedMessage parameter, but I have not figured a way to use this type due to needing a static lifetime on the async block. I could detach the borrowed message into an OwnedMessage to satisfy the static lifetime requirement, but store_offset takes a BorrowedMessage parameter and there is no way to produce one from an OwnedMessage. Even if this was possible, it is far from ideal, as store_offset only actually requires the topic, partition, and offset data, and storing the entire message just to access those is rather inefficient.

Is there another way to achieve this process?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions