Consumer acknowledge messages from streams #445
-
Hi, I have a basic question, how correctly consume messages, and how to handle any exceptions in MessageHandler? I ask because MessageHandler doesn't provide a current channel and I can't neck messages like it described here: https://www.rabbitmq.com/streams.html#consuming Maybe it is just unclear to me from the current documentation (https://rabbitmq.github.io/rabbitmq-stream-java-client/stable/htmlsingle) What I use: which depends on MessageHandler and provides me channel as a null |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
If you want to skip messages you have to ignore them and If you want to have more control over how messages are flowing (e.g. to avoid overflowing your consumers), there is a new flow API in 0.11.0. Note that this flow control is independent of offset tracking, which is a way to store at which point a consumer is in a given stream (to be able to restart a new incarnation of the consumer where the previous one left off). |
Beta Was this translation helpful? Give feedback.
If you want to skip messages you have to ignore them and
return
in theMessageHandler
, messages will keep flowing. The acknowledgment with AMQP is just a way of asking for more messages, which is not necessary with the stream client.If you want to have more control over how messages are flowing (e.g. to avoid overflowing your consumers), there is a new flow API in 0.11.0.
Note that this flow control is independent of offset tracking, which is a way to store at which point a consumer is in a given stream (to be able to restart a new incarnation of the consumer where the previous one left off).