Reputation: 1553
First let me tell you set up i have.
The probelm scenario is, I am sending message m1 and then m2. m1 takes time to process. m2 process gets finished before m1. Here for both m1 & m2, delivery tags are same as 1. So message m2 is getting acked before m1 and when m1 is acked, i am getting unknown delivery tag 1 exception.
Surprisingly message m1 ack is received by producer too. But the problem is m1 hands in unacked state for a long time in RMQ admin console.
Is this possible in RMQ that i can ack m2 before m1? I know both messages are on same channel and same queue. The thing is i can not gurantee both message to get delivered to separate queues.
Upvotes: 0
Views: 1417
Reputation: 174749
If they have the same delivery tag, they were delivered on different threads/channels - delivery tags are scoped at the channel level. It appears you are trying to ack m1 on the wrong channel.
Surprisingly message m1 ack is received by producer too.
I don't know what you mean by that - consumer acks don't go to producers; consumers and producers are independent. Producer acks are completely different to consumer acks.
You are advised not to send acks on a different thread; channels are not thread safe.
Upvotes: 1