Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

nodejs-pubsub: add support for filtering #976

@d-torres

Description

@d-torres

Add an additional field for subscriptions that allows configuring a filter. Filters control what messages are sent to subscribers based on the message attributes.

As an example, if a message filter is the string attributes.event_type = "1", then messages with attributes of event_type=1 will be delivered, while everything else will be filtered out.
There will be more complicated filters to handle prefixes and non-exact matches, but any integration tests can just test the exact match case.

If empty, no messages are filtered out. Filtering can be configured only on subscription creation, not on updates.

Reference implementation in Go will be tracked under googleapis/google-cloud-go#1943

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the googleapis/nodejs-pubsub API.priority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions