[rabbitmq-discuss] pika and node.amqp interop

Ricardo Brízido ricardo.brizido at gmail.com
Thu Oct 20 16:55:58 BST 2011


For some reason I can't get this example to work:


[sender]
var sys = require('sys');
var amqp = require('./amqp');

var connection = amqp.createConnection({ host: 'localhost' });

// Wait for connection to become established.
connection.addListener('ready', function () {
    var x = connection.exchange()
    var q = connection.queue("aqueuename",
             { autoDelete: true, durable: false, exclusive: false });
    x.publish('aqueuename', {foo: "bar"});
});

[receiver]
#!/usr/bin/env python
import pika

connection = pika.AsyncoreConnection(pika.ConnectionParameters(
        host='localhost'))
channel = connection.channel()

q = channel.queue_declare(queue='aqueuename',
                         auto_delete=True,
                         durable=False,
                         exclusive=False)

print ' [*] Waiting for messages. To exit press CTRL+C'

def callback(ch, method, properties, body):
    print " [x] Received %r" % (body,)

channel.basic_consume(callback,
                      queue='aqueuename',
                      no_ack=True)

pika.asyncore_loop()


I wanted to used a BlockingConnection. Do you know if this works with
a BlockingConnection?


Thanks

Ricardo


-- 
Ricardo Brízido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20111020/154fc577/attachment.htm>


More information about the rabbitmq-discuss mailing list