<@U078Y59KC3B> Is it possible to get the enqueued ...
# ask-ai
j
@RunLLM Is it possible to get the enqueued timestamp of the last message in a topic via the Pulsar Admin API through a single or mutiple chained admin API calls?
r
You cannot directly get the enqueued (publish) timestamp of the last message in a topic with a single Pulsar Admin API call. The admin API provides a way to get the last message ID (
last-message-id
), but not its timestamp in the same call. To obtain the timestamp, you must first fetch the last message ID, then use that ID to retrieve the message and extract its publish time, requiring at least two chained admin API calls. This process is not available as a single atomic admin API operation according to the official documentation and API references (Pulsar Admin API, last-message-id, get-message-by-id). Would you like more detail or example code for this process? Sources: - Pulsar Admin API - get-internal-stats - Pulsar Admin API - last-message-id 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
j
@RunLLM get message by id only returns the body of the message itself, and not any message metadata
r
Correct. The Pulsar Admin API's "get message by id" endpoint returns the raw message payload (body), not the message metadata (such as publish time, properties, or event time). To access metadata, you must use a Pulsar client library, which can deserialize and expose metadata fields (Pulsar Admin API docs, GitHub issue). Would you like more detail or a code example for extracting metadata using a client library? Sources: - Pulsar Admin API - get-internal-stats - GitHub Issue: Peek nth message REST API returns incorrect data 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.