Last active
August 29, 2015 14:24
-
-
Save duncanfinney/661f010a5d926f105005 to your computer and use it in GitHub Desktop.
Revisions
-
duncanfinney revised this gist
Jul 9, 2015 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,4 +28,5 @@ connection.on('ready', function () { connection.publish('my-queue', { hello: 'world' }); connection.publish('my-queue', { hello: 'world' }); }); }); -
duncanfinney created this gist
Jul 9, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ var amqp = require('amqp'); var connection = amqp.createConnection({ host: '192.168.64.10', port: 5672 }); // Wait for connection to become established. connection.on('ready', function () { console.log('ready'); // Use the default 'amq.topic' exchange connection.queue('my-queue', function (q) { // Catch all messages q.bind('#'); // Receive messages q.subscribe(function (message) { // Print messages to stdout console.log('got a message: ', message); }); q.subscribe(function(message) { console.log('got a message 2: ', message); }) connection.publish('my-queue', { hello: 'world' }); connection.publish('my-queue', { hello: 'world' }); connection.publish('my-queue', { hello: 'world' }); connection.publish('my-queue', { hello: 'world' }); connection.publish('my-queue', { hello: 'world' }); connection.publish('my-queue', { hello: 'world' }); });