pulsar-client-node icon indicating copy to clipboard operation
pulsar-client-node copied to clipboard

getRedeliveryCount always return 0

Open franck-mahieu opened this issue 2 years ago • 4 comments

Hello,

Is there a way to make message.getRedeliveryCount() return the number of time a message has been redelivered? I hope it's not a problem between the chair and the keyboard, but in my case, the function always returns 0.

I tried to let the default parameters on subscribe, but it doesn't change anything. There is no disconnection of the client between each redelivery. The message is well nack each time.

i use pulsar-client v1.8 and kezhenxu94/pulsar pulsar container (pulsar 2.10.0).

franck-mahieu avatar Feb 10 '23 09:02 franck-mahieu

@franck-mahieu Which subscription type did you use? Currently, Message.getRedeliveryCount() always return 0 if subscription type is Exclusive or Failover.

izumo27 avatar Feb 17 '23 02:02 izumo27

Hi. I seem to have this issue as well. I have several messages in the backlog that I know have been processed by a consumer based on the service logs. When I inspect the message, there is no redeliveryCount property set which is causing my consumer to go into an infinite loop reprocessing. I have the Shared subscription type

@izumo27 and help appreciated :)

fabianwikstrom avatar Mar 06 '24 21:03 fabianwikstrom

@fabianwikstrom Could you explain what 'inspect the message' means? I would like to see the consumer code.

izumo27 avatar Mar 08 '24 02:03 izumo27

Hi @izumo27 . We figured it out. Turns out that we have batchIndexAckEnabled enabled on the consumer but not on the broker and that is what led to the redelivery loop. I'll close my other issue

Thank you for the quick response!

fabianwikstrom avatar Mar 08 '24 16:03 fabianwikstrom