Skip to content

Nats JetStream Improvements

Compare
Choose a tag to compare
@github-actions github-actions released this 22 Jun 22:04
· 205 commits to master since this release
27cd6a9

Fixes:

  • When writing to Nats JetStream, --stream flag has been changed to the more correct --subject flag

Improvements:
New options for consuming from Nats JetStream have been added:

      --consumer-name=STRING              Consumer name (default: random consumer name; has no effect if
                                          create_durable_consumer or existing_durable_consumer is not set)
                                          ($PLUMBER_RELAY_NATS_JETSTREAM_CONSUMER_NAME)
      --create-durable-consumer           Create a new durable consumer (default: use ephemeral consumer)
                                          ($PLUMBER_RELAY_NATS_JETSTREAM_CREATE_DURABLE_CONSUMER)
      --existing-durable-consumer         Use an existing durable consumer (default: use ephemeral consumer)
                                          ($PLUMBER_RELAY_NATS_JETSTREAM_EXISTING_DURABLE_CONSUMER)
      --keep-consumer                     Do not delete consumer after operation is done (default: delete on exit)
                                          ($PLUMBER_RELAY_NATS_JETSTREAM_KEEP_CONSUMER)
      --consumer-start-sequence=INT-64    Where to start read in stream (default: from start)
                                          ($PLUMBER_RELAY_NATS_JETSTREAM_CONSUMER_START_SEQUENCE)
      --consumer-start-time=STRING        At what time to start stream (RFC3339 format, Ex: 2016-06-20T12:41:45.14Z)
                                          ($PLUMBER_RELAY_NATS_JETSTREAM_CONSUMER_START_TIME)
      --consumer-filter-subject=STRING    Only receive a subset of messages from the Stream based on the subject
                                          ($PLUMBER_RELAY_NATS_JETSTREAM_CONSUMER_FILTER_SUBJECT)

By default, plumber will use an ephemeral consumer (which does not track stream sequence bits). To track sequence numbers/offsets, use create-durable-consumer or create one by hand and specify it via --existing-durable-consumer and --consumer-name.

NOTE: If you specify consumer-start-sequence - this applies to the consumer config so once the consumer consumes from sequence XYZ, a follow-up consume won't produce the same results. If you want to always consume from a given position - do create-durable-consumer every time.