Description
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?