Closed kimdre closed 6 months ago
Ok was I was able to fix it myself.
I didn't need the line below, since with this line all messages get ack'ed and rejected based on their return value/exception in this context manager, which in my case sent an ack
whenever I append the message to the list.
async with message.process(ignore_processed=True):
Hi,
Can you
ack
orreject
messages outside of the context manager for processing the message? Since I collect messages before writing them as bulk to a database in intervals, my context manager only contains a list append for these messages and I do the actual processing in a different loop/context where I would also like to send theack
if the processing there was actualy Ok.The documentation could not help me unfortuantely.
My process context manager looks like this.
And the function that does the actual processing and sends the
ack
if everything was fine:It seems like the
message.ack()
does not work here, as I get aMessageProcessError
that says "'Message already processed'".