Node.AMQP.Types
- Package
- purescript-amqp
- Repository
- abhin4v/purescript-amqp
#Connection Source
data Connection :: Type
An AMQP connection.
#ExchangeName Source
type ExchangeName = String
An AMQP exchange name.
#RoutingKey Source
type RoutingKey = String
An AMQP routing key.
#ConnectOptions Source
type ConnectOptions = { channelMax :: Int, frameMax :: Int, heartbeat :: Seconds }
Options used to connect to the AMQP server. See http://www.squaremobius.net/amqp.node/channel_api.html#connect for details.
#defaultConnectOptions Source
defaultConnectOptions :: ConnectOptions
Default connection options.
#AssertQueueOK Source
type AssertQueueOK = { consumerCount :: Int, messageCount :: Int, queue :: String }
Reply from the server for asserting a queue. Contains the name of queue asserted, the count of the messages in the queue, and the count of the consumers of the queue.
#DeleteQueueOK Source
type DeleteQueueOK = { messageCount :: Int }
Reply from the server for deleting a queue. Contains the count of the mssages in the queue.
#PurgeQueueOK Source
type PurgeQueueOK = { messageCount :: Int }
Reply from the server for purging a queue. Contains the count of the mssages purged from the queue.
#ExchangeType Source
data ExchangeType
Types of AMQP exchanges. See https://www.rabbitmq.com/tutorials/amqp-concepts.html for details.
Constructors
Instances
#QueueOptions Source
type QueueOptions = { arguments :: StrMap Foreign, autoDelete :: Maybe Boolean, deadLetterExchange :: Maybe String, deadLetterRoutingKey :: Maybe RoutingKey, durable :: Maybe Boolean, exclusive :: Maybe Boolean, expires :: Maybe Milliseconds, maxLength :: Maybe Int, maxPriority :: Maybe Int, messageTTL :: Maybe Milliseconds }
Options used to create a queue:
exclusive
: if true, the queue is used by only one connection and is deleted when that connection closes.durable
: if true, the queue survives broker restarts.autoDelete
: if true, the queue is deleted when there is no consumers for it.messageTTL
: if specified, expires messages arriving in the queue after n milliseconds.expires
: if specified, the queue is destroyed after n milliseconds of disuse, where "use" means having consumers, being asserted or checked, or being polled.deadLetterExchange
: if specified, an exchange to which messages discarded from the queue are resent to.deadLetterRoutingKey
: if specified, set as the routing key for the discarded messages.maxLength
: if specified, the maximum number of messages the queue holds.maxPriority
: if specified, makes the queue a priority queue.arguments
: additional arguments.
See http://www.squaremobius.net/amqp.node/channel_api.html#channel_assertQueue for details.
#defaultQueueOptions Source
defaultQueueOptions :: QueueOptions
Default options to create a queue. Every field is set to Nothing
or empty
.
#DeleteQueueOptions Source
type DeleteQueueOptions = { ifEmpty :: Maybe Boolean, ifUnused :: Maybe Boolean }
Options used to delete a queue:
ifUnused
: if true and the queue has consumers, it is not deleted and the channel is closed.ifEmpty
: if true and the queue contains messages, the queue is not deleted and the channel is closed.
See http://www.squaremobius.net/amqp.node/channel_api.html#channel_deleteQueue for details.
#defaultDeleteQueueOptions Source
defaultDeleteQueueOptions :: DeleteQueueOptions
Default options to delete a queue. Every field is set to Nothing
.
#ExchangeOptions Source
type ExchangeOptions = { alternateExchange :: Maybe String, arguments :: StrMap Foreign, autoDelete :: Maybe Boolean, durable :: Maybe Boolean, internal :: Maybe Boolean }
Options to create an exchange:
durable
: if true, the exchange survives broker restarts.internal
: if true, messages cannot be published directly to the exchange.autoDelete
: if true, the exchange is destroyed once it has no bindings.alternateExchange
: if specified, an exchange to send messages to if this exchange can't route them to any queues.arguments
: additional arguments.
See http://www.squaremobius.net/amqp.node/channel_api.html#channel_assertExchange for details.
#defaultExchangeOptions Source
defaultExchangeOptions :: ExchangeOptions
Default options to create an exchange. Every field is set to Nothing
or empty
.
#DeleteExchangeOptions Source
type DeleteExchangeOptions = { ifUnused :: Maybe Boolean }
Options to delete an exchange:
ifUnused
: if true and the exchange has bindings, it is not deleted and the channel is closed.
See http://www.squaremobius.net/amqp.node/channel_api.html#channel_deleteExchange for details.
#defaultDeleteExchangeOptions Source
defaultDeleteExchangeOptions :: DeleteExchangeOptions
Default options to delete an exchange. Every field is set to Nothing
.
#PublishOptions Source
type PublishOptions = { appId :: Maybe String, bcc :: Array RoutingKey, cc :: Array RoutingKey, contentEncoding :: Maybe String, contentType :: Maybe String, correlationId :: Maybe String, expiration :: Maybe Milliseconds, headers :: StrMap Foreign, mandatory :: Maybe Boolean, messageId :: Maybe String, persistent :: Maybe Boolean, priority :: Maybe Int, replyTo :: Maybe QueueName, timestamp :: Maybe Instant, type :: Maybe String, userId :: Maybe String }
Options to publish a message:
expiration
: if specified, the message is discarded from a queue once it has been there longer than the given number of milliseconds.userId
: if specified, RabbitMQ compares it to the username supplied when opening the connection, and rejects the messages for which it does not match.cc
: an array of routing keys; messages are routed to these routing keys in addition to the given routing key.bcc
: likecc
, except that the value is not sent in the message headers to consumers.priority
: if specified, a priority for the message.persistent
: if true, the message survives broker restarts provided it is in a queue that also survives restarts.mandatory
: if true, the message is returned if it is not routed to a queue.contentType
: a MIME type for the message content.contentEncoding
: a MIME encoding for the message content.headers
: application specific headers to be carried along with the message content.correlationId
: usually used to match replies to requests, or similar.replyTo
: often used to name a queue to which the receiving application must send replies, in an RPC scenario.messageId
: arbitrary application-specific identifier for the message.timestamp
: a timestamp for the message.type
: an arbitrary application-specific type for the message.appId
: an arbitrary identifier for the originating application.
See http://www.squaremobius.net/amqp.node/channel_api.html#channel_publish for details.
#defaultPublishOptions Source
defaultPublishOptions :: PublishOptions
Default options to publish a message. Every field is set to Nothing
.
#MessageFields Source
type MessageFields = { consumerTag :: String, deliveryTag :: String, exchange :: ExchangeName, redelivered :: Boolean, routingKey :: RoutingKey }
Fields of a message received by a consumer:
deliveryTag
: a serial number for the message.consumerTag
: an identifier for the consumer for which the message is destined.exchange
: the exchange to which the message was published.routingKey
: the routing key with which the message was published.redelivered
: if true, indicates that this message has been delivered before and has been handed back to the server.
#MessageProperties Source
type MessageProperties = { appId :: Maybe String, contentEncoding :: Maybe String, contentType :: Maybe String, correlationId :: Maybe String, expiration :: Maybe Milliseconds, headers :: StrMap Foreign, messageId :: Maybe String, persistent :: Maybe Boolean, priority :: Maybe Int, replyTo :: Maybe QueueName, timestamp :: Maybe Instant, type :: Maybe String, userId :: Maybe String }
Properties of a message received by a consumer. A subset of the PublishOptions
fields.
#Message Source
type Message = { content :: Buffer, fields :: MessageFields, properties :: MessageProperties }
A message received by a consumer:
content
: the content of the message a buffer.fields
: the message fields.properties
: the message properties.
#ConsumeOptions Source
type ConsumeOptions = { arguments :: StrMap Foreign, consumerTag :: Maybe String, exclusive :: Maybe Boolean, noAck :: Maybe Boolean, noLocal :: Maybe Boolean, priority :: Maybe Int }
Options used to consume message from a queue:
consumerTag
: an identifier for this consumer, must not be already in use on the channel.noLocal
: if true, the broker does not deliver messages to the consumer if they were also published on this connection. RabbitMQ doesn't implement it, and will ignore it.noAck
: if true, the broker does expect an acknowledgement of the messages delivered to this consumer. It dequeues messages as soon as they've been sent down the wire.exclusive
: if true, the broker does not let anyone else consume from this queue.priority
: gives a priority to the consumer. Higher priority consumers get messages in preference to lower priority consumers.arguments
: additional arguments.
See http://www.squaremobius.net/amqp.node/channel_api.html#channel_consume for details.
#defaultConsumeOptions Source
defaultConsumeOptions :: ConsumeOptions
Default options to consume messages from a queue. Every field is set to Nothing
or empty
.
#GetOptions Source
type GetOptions = { noAck :: Maybe Boolean }
Options used to get a message from a queue:
noAck
: if true, the broker does expect an acknowledgement of the messages delivered to this consumer. It dequeues messages as soon as they've been sent down the wire.
#defaultGetOptions Source
defaultGetOptions :: GetOptions
Default options to get a message from a queue. Every field is set to Nothing
.