Module amqp_selective_consumer
This module is an implementation of the amqp_gen_consumer
behaviour and can be used as part of the Consumer parameter when
opening AMQP channels.
Behaviours: amqp_gen_consumer.
This module is an implementation of the amqp_gen_consumer
behaviour and can be used as part of the Consumer parameter when
opening AMQP channels. This is the default implementation selected
by channel.
The Consumer parameter for this implementation is {amqp_selective_consumer, []}
This consumer implementation keeps track of consumer tags and sends
the subscription-relevant messages to the registered consumers, according
to an internal tag dictionary.
Send a #basic.consume{} message to the channel to subscribe a
consumer to a queue and send a #basic.cancel{} message to cancel a
subscription.
The channel will send to the relevant registered consumers the
basic.consume_ok, basic.cancel_ok, basic.cancel and basic.deliver messages
received from the server.
If a consumer is not registered for a given consumer tag, the message
is sent to the default consumer registered with
amqp_selective_consumer:register_default_consumer. If there is no default consumer
registered in this case, an exception occurs and the channel is abruptly
terminated.
register_default_consumer(ChannelPid, ConsumerPid) -> ok
- ChannelPid = pid()
- ConsumerPid = pid()
This function registers a default consumer with the channel. A
default consumer is used when a subscription is made via
amqp_channel:call(ChannelPid, #'basic.consume'{}) (rather than
amqp_selective_consumer:subscribe/3) and hence there is no consumer pid
registered with the consumer tag. In this case, the relevant
deliveries will be sent to the default consumer.
Generated by EDoc