Getting Next Message via API #16914
-
In the docs, it says commit is automatic. but when I run the command from the examples:
I get my message. but when I run it again, I get the same message? I was expecting the message to have gone as I consumed it. so either I am understanding something wrong, or I failed to do something. In the UI there is Consumer Groups, I have not created any, as the tutorial didnt mention it. I have never used Kafka so this is my first steps into Redpanda. Can anyone guide what the process or use method is? and how do I prevent re-consuming messages? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@cyberience you can do a few things, pass --offset=1 to get the next message. You could adjust --num=2 to get both messages, or pass --offset=-1 to get the latest message always (in conjunction with --num=1). --num is really more like --limit, if you remove that flag you can get all messages for the topic The help text for this command is quite good too, so you can pass --help or read the help online here: https://docs.redpanda.com/current/reference/rpk/rpk-topic/rpk-topic-consume/ |
Beta Was this translation helpful? Give feedback.
@cyberience you can do a few things, pass --offset=1 to get the next message. You could adjust --num=2 to get both messages, or pass --offset=-1 to get the latest message always (in conjunction with --num=1). --num is really more like --limit, if you remove that flag you can get all messages for the topic
The help text for this command is quite good too, so you can pass --help or read the help online here: https://docs.redpanda.com/current/reference/rpk/rpk-topic/rpk-topic-consume/