Stargate.Receiver.start_link
You're seeing just the function
start_link
, go back to Stargate.Receiver module for more information.
Specs
start_link(keyword()) :: GenServer.on_start()
Start a consumer or reader websocket process and link it to the current process.
Consumer and Receiver options require, at minimum:
* `host` is a tuple of the address or URL of the Pulsar cluster (broker service)
and the port on which the service is exposed.
* `tenant` is a string representing the tenant portion of the receiver URL path parameter.
* `namespace` is a string representing the topic portion of the receiver URL path parameter.
* `topic` is a string representing the topic portion of the receiver URL path parameter.
* `subscription` (for consumers) is a string representing the subscription portion of the
receiver URL path paramater.
* `registry` is the name of the process registry associated to the client's supervision tee.
Stargate uses this to subscribe to the stages of the receiver and to send messages back
and forth between them.
* `handler` is the name of the handler module that implements the
`Stargate.Receiver.MessageHandler` behaviour.
Additional optional parameters to a consumer and reader are:
* `protocol` can be one of "ws" or "wss"; defaults to "ws".
* `persistence` can be one of "persistent" orr "non-persistent" per the Pulsar specification
of topics as being in-memory only or persisted to the brokers' disks. Defaults to "persistent".
* `processors` is the number of GenStage processes in the "processor" stage to be created.
This is the stage that performs the work of the message handler to perform processing logic
on the received messages. Defaults to 1.
* `handler_init_args` is any term that will be passed to the message handler to initialize
its state when a stateful handler is desired. Defaults to an empty list.
* `query_params` is a map containing any or all of the following:
# Consumer
* `ack_timeout` sets the timeout for unacked messages. Defaults to 0.
* `subscription_type` can be one of `:exclusive`, `:failover`, or `:shared` to tell
the Pulsar cluster if one or more consumers will be receiving messages on this topic
and subscription. Defaults to exclusive.
* `queue_size` sets the number of messages in the consumer's receive queue. Defaults to 1000.
* `name` registers a name for the consumer client with the Pulsar cluster.
* `priority` sets the priority with the cluster for the consumer client to receive messages.
* `max_redeliver_count` defines a maximum number of times to attempt redelivery of a message
to the consumer before sending it to a dead letter queue. Activates the dead letter topic feature.
* `dead_letter_topic` defines a name for a topic's corresponding dead letter topic. Activates
the dead letter topic feature. Defaults to "{topic}-{subscription}-DLQ".
* `pull_mode` can be `true` or `false`. When a consumer is in pull mode, the cluster will hold
messages on the subscription until it receives a permit request with an explicit number
of desired messages to fulfill.
# Reader
* `name` registers a name for the reader client with the Pulsar cluster.
* `queue_size` is the size of the queue maintained for the reader; defaults to 1000.
* `starting_message` can be one of `:earliest`, `:latest`, or a message ID.
Sets the reader's cursor to the desired message within the stream. Defaults to latest.