Jetstream Sequence Number and/or Last Sequence Number in Subject #4147
-
The Jetstream "RePublish" functionality provides Example:
When using a "normal" consumer no such information is provided:
Is there any way to receive the Sequence Number of a message when receiving messages from a Subscriber - or even better the Last Sequence Number? I'm building an event sourcing setup where I have a large number of ephemeral consumers (devices) that need to catch up and then process messages. Jetstream would act as a event stream that will be limited in length. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You want to use the messages metadata which has everything you want. meta, err := msg.Metadata() The struct from the Go client. // MsgMetadata is the JetStream metadata associated with received messages.
type MsgMetadata struct {
Sequence SequencePair
NumDelivered uint64
NumPending uint64
Timestamp time.Time
Stream string
Consumer string
Domain string
} |
Beta Was this translation helpful? Give feedback.
You want to use the messages metadata which has everything you want.
The struct from the Go client.