Skip to content

How to read entire log? #378

Answered by acogoluegnes
CoenraadS asked this question in Q&A
May 22, 2024 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

Note the "last offset" of a stream is a moving target, unless the stream is read-only (no application publishing to it).

There are different ways to read the whole stream:

  • Use the StreamStats command and use the committedChunkId value. This is a good enough approximation of the end of the stream at a given time. The value - how precise it is - is stale as soon as you receive it if messages are published to the stream anyway.
  • Create a consumer with the LAST offset specification and calculate the last offset with the chunk information (use the chunk ID and the number of messages in the chunk). This will require to use the low-level API of the client library. Then you can create a consumer …

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@CoenraadS
Comment options

@Gsantomaggio
Comment options

@acogoluegnes
Comment options

Answer selected by acogoluegnes
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants