AMQPHelpers.Reliability.Consumer.start_link
You're seeing just the function
start_link
, go back to AMQPHelpers.Reliability.Consumer module for more information.
Link to this function
start_link(opts \\ [])
Specs
start_link(options()) :: GenServer.on_start()
Starts a Consumer
process linked to the current process.
Options
The following option can be given to Consumer
when starting it. Note that
message_handler
and queue_name
are required.
adapter
- Sets theAMQPHelpers.Adapter
. Defaults toAMQPHelpers.Adapters.AMQP
.channel
- The channel to use to consume messages. NOTE: do not use this for production environments because this Consumer does not supervise the given channel. Instead, usechannel_name
which makes use ofAMQP.Application
.channel_name
- The name of the configured channel to use. SeeAMQP.Application
for more information. Defaults to:default
.consume_on_init
- If the consumer should start consuming messages on init or not. Defaults totrue
.consume_options
- The options given toAMQPHelpers.Adapter.consume/4
.message_handler
- The function that will deal with messages. Required.prefetch_count
- The maximum number of unacknowledged messages in the channel. SeeAMQP.Basic.qos2
for more info.prefetch_size
- The maximum number of unacknowledged bytes in the channel. SeeAMQP.Basic.qos2
for more info.queue_name
- The name of the queue to consume. Required.requeue
- Whether to requeue messages or not after a consume error. Defaults totrue
.retry_interval
- The number of millisecond to wait if an error happens when trying to consume messages or when trying to open a channel.shutdown_gracefully
- If enabled, the consumer will cancel the subscription when terminating. Default tofalse
but enforced ifconsumer_options
hasexclusive
set totrue
.task_supervisor
- TheTask.Supervisor
which runs message handling tasks. If not provided, theConsumer
will handle messages synchronously.
GenServer.options/0
are also available. See GenServer.start_link/2
for
more information about these.