spotter v0.6.0 Spotter.Testing.AmqpBlockingClient
A blocking AMPQ client for testing purposes and simple RPC use cases.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor
Initializes QoS, a queue and an exchanges for the channel
Returns the message from the certain queue if it exists
Initializes a new connection and a channel
Sends a new message without waiting for a response
Sends a new message and wait for result
Initializes a new blocking GenServer instance
Stop the client and close the existing connection
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Initializes QoS, a queue and an exchanges for the channel.
The channel_opts
parameters stores generic information about the response queue and the linked exchange.
The call_timeout
parameter determines maximum amount time in milliseconds before exit from the method by timeout.
Returns the message from the certain queue if it exists.
The queue
parameter represents the name of the queue which will be used for tracking responses.
The timeout
parameter determines amout of time before doing next attempt to extract the message.
The attemps
parameter determines the general amount of attempts to extract the message.
The call_timeout
parameter determines maximum amount time in milliseconds before exit from the method by timeout.
Initializes a new connection and a channel.
Sends a new message without waiting for a response.
The data
parameter represents a payload, added to the message body.
The ops
parameter represented as a keyword, that can contain keys:
:request_exchange
- Exchange key, through which will be published message.:request_routing_key
- Routing key, used for pushing message to the certain queue.:mandatory
- If set, returns an error if the broker can’t route the message to a queue (defaultfalse
);:immediate
- If set, returns an error if the broker can’t deliver te message to a consumer immediately (defaultfalse
);:content_type
- MIME Content type;:content_encoding
- MIME Content encoding;:headers
- Custom message headers;:persistent
- Determines delivery mode. Messages marked aspersistent
and delivered todurable
queues will be logged to disk;:correlation_id
- Application correlation identifier;:priority
- Message priority, ranging from 0 to 9;:reply_to
- Name of the reply queue;:expiration
- How long the message is valid (in milliseconds);:message_id
- Message identifier;:timestamp
- Timestamp associated with this message (epoch time);:type
- Message type (as a string);:user_id
- User ID. Validated by RabbitMQ against the active connection user;:app_id
- Publishing application ID.
The call_timeout
parameter determines maximum amount time in milliseconds before exit from the method by timeout.
Sends a new message and wait for result.
The data
parameter represents a payload, added to the message body.
The ops
parameter represented as a keyword, that can contain keys:
:request_exchange
- Exchange key, through which will be published message. Required.:request_routing_key
- Routing key, used for pushing message to the certain queue. Required.:response_queue
- The name of the queue which will be used for tracking responses. Required.:channel_opts
- Keyword list which is used for creating response queue and linking it with the exchange. Required.:mandatory
- If set, returns an error if the broker can’t route the message to a queue (defaultfalse
);:immediate
- If set, returns an error if the broker can’t deliver te message to a consumer immediately (defaultfalse
);:content_type
- MIME Content type;:content_encoding
- MIME Content encoding;:headers
- Custom message headers;:persistent
- Determines delivery mode. Messages marked aspersistent
and delivered todurable
queues will be logged to disk;:correlation_id
- Application correlation identifier;:priority
- Message priority, ranging from 0 to 9;:reply_to
- Name of the reply queue;:expiration
- How long the message is valid (in milliseconds);:message_id
- Message identifier;:timestamp
- Timestamp associated with this message (epoch time);:type
- Message type (as a string);:user_id
- User ID. Validated by RabbitMQ against the active connection user;:app_id
- Publishing application ID.
The timeout
parameter determines amout of time before doing next attempt to extract the message.
The attemps
parameter determines the general amount of attempts to extract the message.
The call_timeout
parameter determines maximum amount time in milliseconds before exit from the method by timeout.
Initializes a new blocking GenServer instance.
Stop the client and close the existing connection.