Skip to main content

stream_subject_is_compatible

Function stream_subject_is_compatible 

Source
pub fn stream_subject_is_compatible(
    existing: &str,
    desired_namespace: &str,
) -> bool
Expand description

Checks whether an existing stream subject is compatible with a desired one.

An exact match is compatible. When the desired subject is a legacy wildcard <prefix>.*.data.*, an existing subject is also compatible if it starts with <prefix>. and ends with .data.*, so an older per-asset pattern such as avenabox.1456.data.* is accepted. Anything else is incompatible.

§Arguments

  • existing - A subject already configured on the JetStream stream.
  • desired_namespace - The subject the current config wants, typically from live_labjack_stream_subject.

§Examples

("avenabox.1456.data.*", "avenabox.*.data.*")         -> true
("avenabox.*.data.*", "avenabox.*.data.*")            -> true
("avenars.i69.a.b.live.*", "avenars.i69.a.c.live.*")  -> false