View Source Polyn.Migration (Polyn v0.6.3)
Functions for making changes to a NATS server
Link to this section Summary
Functions
Creates a new Consumer for a stream. Options are what's available on
Jetstream.API.Consumer.t()
.
Note: Consumers can't be updated after they are created. You must delete and
recreate it instead.
Creates a new Stream for storing messages. Options are what's available on
Jetstream.API.Stream.t()
Deletes a consumer from a stream. Consumers can have the same name for different streams so you must supply the stream name.
Deletes a Stream for storing messages.
Updates a Stream for storing messages. Options are what's available on
Jetstream.API.Stream.t()
. The :name
is required and must be an already
created Stream
Link to this section Functions
@spec create_consumer(consumer_options :: keyword()) :: :ok
Creates a new Consumer for a stream. Options are what's available on
Jetstream.API.Consumer.t()
.
Note: Consumers can't be updated after they are created. You must delete and
recreate it instead.
examples
Examples
iex>create_consumer(durable_name: "test_consumer", stream_name: "test_stream")
:ok
@spec create_stream(stream_options :: keyword()) :: :ok
Creates a new Stream for storing messages. Options are what's available on
Jetstream.API.Stream.t()
examples
Examples
iex>create_stream(name: "test_stream", subjects: ["test_subject"])
:ok
@spec delete_consumer(consumer_options :: keyword()) :: :ok
Deletes a consumer from a stream. Consumers can have the same name for different streams so you must supply the stream name.
examples
Examples
iex>delete_consumer(durable_name: "test_consumer", stream_name: "test_stream")
:ok
@spec delete_stream(stream_name :: binary()) :: :ok
Deletes a Stream for storing messages.
examples
Examples
iex>delete_stream("test_stream")
:ok
@spec update_stream(stream_options :: keyword()) :: :ok
Updates a Stream for storing messages. Options are what's available on
Jetstream.API.Stream.t()
. The :name
is required and must be an already
created Stream
examples
Examples
iex>update_stream(name: "test_stream", description: "my test stream")
:ok