1.3.6 • Published 9 years ago

amqpjs v1.3.6

Weekly downloads
3
License
ISC
Repository
github
Last release
9 years ago

amqpjs

wraps the connection object from the amqplib module to a simple way to be used

V1.3

test & code coverage: npm test && npm run open-coverage

codestyle: npm run codestyle

jshint: npm run jshint

see the tests for the configurations used

####App

amqpjs([uri], [socketOptions])

uri: can be a string amqp://guest:guest@localhost:5672/test or an object {vhost: vhost, port: 5672, user: 'guest', password: 'guest', ssl: false}

socketOptions: an object {channelMax: 100, heartbeat: 300, noDelay: true} see here for more information (search by socket options :-) )

event to handle the connection issues

on('error', function(err) {...})

create a channel *This channel is a "virtual" connection inside the "real" TCP connection, and it is over the channel that you issue AMQP commands.**

createChannel(function(err, channel) {...})

close the connection

close()

event to handle the close connection

on('close', function() {...});

####Example

var amqpjs  = require('amqpjs');

var client = amqpjs([uri], [socketOptions]);

//
// with this event you can capture
// connections failures
//
client.on('error', function(err) {...});

client.on('close', function() {...});

//
// can create several channels
//
client.createChannel(function(err, channel) {...});

client.createChannel(function(err, channel) {
	// err
	// do something with channel
	channel...
	// close this channel
	channel.close(function(err) {
		client.close();
	});
});

you can check a better example of a producer & a consumer in here.

for full understanding you can follow the amqplib documentation here.

1.3.6

9 years ago

1.3.5

9 years ago

1.3.4

9 years ago

1.3.3

9 years ago

1.3.2

9 years ago

1.2.2

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

10 years ago

0.5.4

10 years ago

0.5.3

10 years ago

0.4.3

10 years ago

0.4.2

10 years ago

0.4.1

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago