Skip to content

Add SubscribeAllEnvelopes endpoint to the Replication API#322

Merged
Maelkum merged 2 commits intomainfrom
maelkum/subscribe-all
Mar 4, 2026
Merged

Add SubscribeAllEnvelopes endpoint to the Replication API#322
Maelkum merged 2 commits intomainfrom
maelkum/subscribe-all

Conversation

@Maelkum
Copy link
Contributor

@Maelkum Maelkum commented Mar 4, 2026

This PR introduces a new endpoint to the Replication API specification, allowing subscription to all envelopes, with a cursor to optionally specify starting point.

This is a somewhat distinct version of SubscribeEnvelopes, which mandates that either topics or originators are specified in the query filter.

This endpoint will be primarily (only) used by the notification server, and will have separate authorization and rate limit settings (details TBD).

Part of work on xmtp/example-notification-server-go#61

Note

Add SubscribeAllEnvelopes RPC endpoint to the Replication API

Adds a new SubscribeAllEnvelopes streaming RPC to the ReplicationApi service in message_api.proto, exposed as POST /mls/v2/subscribe-all-envelopes. The new SubscribeAllEnvelopesRequest message accepts an optional last_seen cursor to support resumable streaming, and returns a stream of SubscribeEnvelopesResponse messages.

Macroscope summarized 1565c0e.

@Maelkum Maelkum self-assigned this Mar 4, 2026
@Maelkum Maelkum requested a review from a team as a code owner March 4, 2026 19:54
};
}

rpc SubscribeAllEnvelopes(SubscribeAllEnvelopesRequest) returns (stream SubscribeEnvelopesResponse) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return type is reused - shared with the SubscribeEnvelopes endpoint, since they return the same thing

@Maelkum Maelkum merged commit c02c1ae into main Mar 4, 2026
7 of 8 checks passed
@Maelkum Maelkum deleted the maelkum/subscribe-all branch March 4, 2026 20:07
Copy link
Collaborator

neekolas commented Mar 4, 2026

I do not believe subscribe all needs a cursor. We don't provide it in the V3 version and it is very expensive to deliver on.

If someone provides a cursor of 0 we are going to try and send them terrabytes of messages immediately.

@Maelkum
Copy link
Contributor Author

Maelkum commented Mar 4, 2026

I do not believe subscribe all needs a cursor. We don't provide it in the V3 version and it is very expensive to deliver on.

If someone provides a cursor of 0 we are going to try and send them terrabytes of messages immediately.

Makes sense, I created an issue to change that in a separate PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants