This article is a mirror article of machine translation, please click here to jump to the original article.

View: 9714|Reply: 0

Kafka manually sets the offset offset

[Copy link]
Posted on 5/8/2021 5:12:09 PM | | | |
View details about a topic

Review:

Kafka operations for .NET/C# message queues [with source code]
https://www.itsvse.com/thread-9619-1-1.html

Prerequisites:All relevant consumer services must be stopped

Just run the following command:

First, check the topic offset offset used under the specified consumer group information:



Note that current-offset and log-end-offset also have lag, which are the current offset, the end offset, and the lagging offset, respectively.

Now it is obvious that the lag is 10546, current-offset=10544, log-end-offset=21090, telling us that there are 10546 unconsumed

CURRENT-OFFSET: The current consumption to the offset is 10544, which can be understood as 10544 has been consumed.

LOG-END-OFFSET: can be understood as a total of 21090 records.

LAG: It can be understood as the number of unconsumed records.

Set the offset offset manually

Check the consumption of the group again, as follows:



Only 3 messages are not consumed, let's open the consumer program to run, as shown in the figure below:



Only the remaining 3 messages were consumed, and the manual adjustment of the offset was successful.

(End)





Previous:ASP.NET pit of the default parameters of the Swagger UI in Core(8).
Next:.NET Core implements distributed locks based on Redis Lua [with source code]
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com