Skip to content

default_subjects per stream #326

@TakahikoKawasaki

Description

@TakahikoKawasaki

Depending on whether the transmitter’s default_subjects is set to NONE or ALL, one of the following two use cases becomes impractical in terms of stream creation and configuration:

  1. Receiving events for all subjects
  2. Receiving events only for specific subjects

If default_subjects is NONE, it is impractical to call the add_subject_endpoint once for every subject in order to receive events for all subjects.

Conversely, if default_subjects is ALL, it is impractical to call the remove_subject_endpoint once for every other subject in order to receive events only for specific subjects.

I believe this issue can be resolved if there is a way to configure default_subjects on a per-stream basis when creating a stream. For example, this could be achieved by adding a default_subjects property to the Stream Configuration (i.e., allowing each stream to have its own default_subjects setting).

If one wants to receive events for all subjects, this can be achieved by creating a stream with default_subjects=ALL. On the other hand, if one wants to receive events only for specific subjects, this can be achieved by creating a stream with default_subjects=NONE and then calling the add_subject_endpoint.

As a concrete proposal, I'd like to suggest adding a default_subjects property to the Stream Configuration as described below. What do you think?

default_subjects
Receiver-Supplied, OPTIONAL. The value MUST be either "ALL" or "NONE". If omitted when creating the stream, the transmitter's default_subjects configuration is inherited. "ALL" indicates that events for all subjects are delivered to the stream, and the Receiver must call the remove_subject_endpoint to stop receiving events for specific subjects. Conversely, "NONE" indicates that events are not delivered to the stream by default (except in special cases such as verification events), and the Receiver must call the add_subject_endpoint to receive events for specific subjects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions