AMQPBaseClient

Base class for AMQPClients. Implements everything except how to connect, send data and close the socket

new AMQPBaseClient(vhost: string, username: string, password: string, name: string, platform: string)
Parameters
vhost (string)
username (string)
password (string)
name (string) name of the connection, set in client properties
platform (string) used in client properties
Instance Members
channel(id)
close(params)

AMQPChannel

Represents an AMQP Channel. Almost all actions in AMQP are performed on a Channel.

new AMQPChannel(connection: AMQPBaseClient, id: number)
Parameters
connection (AMQPBaseClient) The connection this channel belongs to
id (number) ID of the channel
Instance Members
queue(name, props, args)
prefetch(prefetchCount)
onReturn(message)
close(params)
basicGet(queue, param)
basicConsume(queue, param, callback)
basicCancel(tag)
basicAck(deliveryTag, multiple)
basicNack(deliveryTag, requeue, multiple)
basicReject(deliveryTag, requeue)
basicRecover(requeue)
basicPublish(exchange, routingKey, data, properties, mandatory?, immediate?)
basicQos(prefetchCount, prefetchSize, global)
basicFlow(active)
confirmSelect()
queueDeclare(name, params, args)
queueDelete(name, params)
queueBind(queue, exchange, routingKey, args)
queueUnbind(queue, exchange, routingKey, args)
queuePurge(queue)
exchangeDeclare(name, type, param, args)
exchangeDelete(name, param)
exchangeBind(destination, source, routingKey, args, exchange)
exchangeUnbind(destination, source, routingKey, args, queue, exchange)
txSelect()
txCommit()
txRollback()

AMQPConsumer

A consumer, subscribed to a queue

new AMQPConsumer(channel: AMQPChannel, tag: string, onMessage: function (message: AMQPMessage))
Parameters
channel (AMQPChannel) the consumer is created on
tag (string) consumer tag
onMessage (function (message: AMQPMessage)) callback executed when a message arrive
Instance Members
wait(timeout?)
cancel()

AMQPError

An error, can be both AMQP level errors or socket errors

new AMQPError(message: string, connection: AMQPBaseClient)

Extends Error

Parameters
message (string)
connection (AMQPBaseClient) The connection the error was raised on
Properties
message (string)
connection (AMQPBaseClient) : The connection the error was raised on

AMQPMessage

AMQP message

new AMQPMessage(channel: AMQPChannel)
Parameters
channel (AMQPChannel) Channel this message was delivered on
Properties
body (Uint8array) : The raw message body
deliveryTag (Uint8array) : The deliveryTag of this message
Instance Members
bodyToString()
ack(multiple)
nack(requeue, multiple)
reject(requeue)

AMQPQueue

Convience class for queues

new AMQPQueue(channel: AMQPChannel, name: string)
Parameters
channel (AMQPChannel) channel this queue was declared on
name (string) name of the queue
Instance Members
bind(exchange, routingkey, args)
unbind(exchange, routingkey, args)
publish(body, properties)
subscribe(params, callback)

AMQPClient

AMQP 0-9-1 client over TCP socket.

new AMQPClient(url: string)

Extends AMQPBaseClient

Parameters
url (string) uri to the server, example: amqp://user:passwd@localhost:5672/vhost
Instance Members
connect()

AMQPWebSocketClient

WebSocket client for AMQP 0-9-1 servers

new AMQPWebSocketClient(url: string, vhost: string, username: string, password: string, name: string)

Extends AMQPBaseClient

Parameters
url (string) to the websocket endpoint
vhost (string = "/") , default '/'
username (string = "guest") , default 'guest'
password (string = "guest") , default 'guest'
name (string = undefined) of the connection, no default
Instance Members
connect()