python - Trying to GET rabbit msg without ack, but no success -
i have task in try messages in rabbit queue. need get, , not consume. here code, using
def some_function_name() : connection = rabbitobj.get_connection() channel = rabbitobj.get_channel(connection) while true : method_frame, header_frame, body = channel.basic_get(queue='error_queue', no_ack=false) if method_frame: #do work else : break #breaking loop while(true): some_function_name()
when run code, works properly,first time.i messages in queue , and messages remain in 'ready' state, when run loop second time, messages turn change 'unacknowledged' state.
requirement : every time should messages,and should not go unacknowledged.
first loop:
second loop :
can me with, doing wrong, or changes should make.
thanks in advance :)
edit 1: @barrenszeppelin 's answer, msgs lost, if set no_ack=true. check below screenshot :
when set no_ack=false
tell broker expect reply, why messages become unacknowledged. try setting no_ack=true
.
Comments
Post a Comment