Skip to content
Browse files

Update README

  • Loading branch information...
1 parent 1a7f26f commit eaf4c27b01b420a2e4439312b9ec19f321bba7f9 @ry ry committed Feb 3, 2010
Showing with 24 additions and 8 deletions.
  1. +22 −5 README
  2. +1 −1 amqp.js
  3. +1 −1 qparser.rb
  4. +0 −1 test.js
View
27 README
@@ -1,14 +1,31 @@
-NodeJS and RabbitMQ can be best friends
+Node AMQP
This is totally not complete at all - you can subscribe to a queue,
but you can't publish or interact with exchanges yet.
-See client.js for an example
+Examples:
+
+ var amqp = require('./amqp');
+
+ var conn = amqp.createConnection({ host: 'dev.rabbitmq.com', port: 5672 });
+
+ conn.addListener("connect", function() {
+ var q = conn.queue('my-events-receiver');
+
+ q.bind("amq.rabbitmq.log", "*");
+
+ q.addListener("message", function (m) {
+ sys.puts(JSON.stringify(m));
+ });
+ });
+
+ conn.addListener("error", function(e) {
+ sys.puts("Error occurred " + e.message);
+ });
+
+
-Part of this code is generated from the AMQP spec. Before using,
-you must run:
- rake generate_from_xml
Major TODOs:
- Helper interfaces for receiving messages
View
2 amqp.js
@@ -1,7 +1,7 @@
var events = require('events'),
sys = require('sys'),
net = require('net'), // requires net2 branch of node
- protocol = require('./amqp-0-8');
+ protocol = require('./amqp-definitions-0-8');
View
2 qparser.rb
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-# USAGE: ruby tools/qparser.rb tools/xml/amqp-0.8.xml > amqp-0-8.js
+# USAGE: ruby qparser.rb amqp-0.8.xml > amqp-definitions-0-8.js
require 'rubygems'
require 'nokogiri'
View
1 test.js
@@ -1,4 +1,3 @@
-
var sys = require('sys');
var amqp = require('./amqp');

0 comments on commit eaf4c27

Please sign in to comment.
Something went wrong with that request. Please try again.