From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p8KAQUSx022582 for ; Tue, 20 Sep 2011 12:26:30 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhkBAL9peE7U4xEJimdsb2JhbABChFmjARQBAQEKCQ0HEgUjgVMBAQQBI1YFCwsYAgImAgJXBhMJh24CBKIukh6BLIRAgREEjCeMQowT X-IronPort-AV: E=Sophos;i="4.68,410,1312149600"; d="scan'208";a="109711756" Received: from moutng.kundenserver.de ([212.227.17.9]) by mail4-smtp-sop.national.inria.fr with ESMTP; 20 Sep 2011 12:26:24 +0200 Received: from office1.lan.sumadev.de (dslb-084-059-072-098.pools.arcor-ip.net [84.59.72.98]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0LlpPU-1RfILX4BEG-00ZjXF; Tue, 20 Sep 2011 12:26:16 +0200 Received: from [192.168.5.106] (dslb-084-059-072-098.pools.arcor-ip.net [84.59.72.98]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id B0E19C00C7; Tue, 20 Sep 2011 12:26:15 +0200 (CEST) From: Gerd Stolpmann To: "Richard W.M. Jones" Cc: caml-list In-Reply-To: <20110919170840.GA4596@annexia.org> References: <1301320989.8429.507.camel@thinkpad> <20110919170840.GA4596@annexia.org> Content-Type: text/plain; charset="UTF-8" Date: Tue, 20 Sep 2011 12:26:15 +0200 Message-ID: <1316514375.16477.17.camel@thinkpad> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:6jlOLAWbzam2A3EpA2Vmit49d+cxCT8385iORb5QYEJ y++miQo6KJHmPvBVDie4aLPpv7k9yxg+5N24xIXOIqshTG4VdJ XsIgLoKyIHK595RbQ1YwyKDHvzOw8+H8Fz44PNxFffXS0fCY6A efCVMWMqFDD3q0z1YwLhHAapl/6efs0B1wCgh0dlS6oYe7KM3A 3SzeCDuZmVK+EkRk+xZXDq8aT0Z01kXTMeq0bp2thBCVBpEXQu U3n7nPCedv0EXdywj+nMpawY5dJK+4s+rH6x2wR41zKJ7PKl+7 VEeRcK1E+tXlYAKg22AZ5aLxnWDzcAxAgW54DvELrqeO3AyWbi AI7fn7Di39ajLOwHXJm0NXfgIqF/E7cOxO/3Twoc+ Subject: Re: [Caml-list] [ANN] Netamqp, a client for AMQP-0-9-1 Am Montag, den 19.09.2011, 18:08 +0100 schrieb Richard W.M. Jones: > On Mon, Mar 28, 2011 at 04:03:09PM +0200, Gerd Stolpmann wrote: > > the ocaml team at Mylife is proud to release another library to the > > public: Netamqp is a client of the AMQP-0-9-1 protocol which is used to > > talk to message queue servers. Netamqp is an independent implementation > > of such a client, and not simply a wrapper around a C library. Netamqp > > has been tested against RabbitMQ. > > Gerd, have you tried to interoperate with any other language? Well, this was developed for Mylife in a project where the sender was written in Python. (I don't have access to this code anymore, though, since I left Mylife.) > I tried examples/t_sender.ml along with the following Python receiver > (all on the same RabbitMQ instance), but the Python code didn't appear > to see any messages at all. I'm quite probably doing something stupid. What's missing here is that you need to bind the queue to an exchange. Remember that t_sender only sends the message to the exchange amq.direct with a routing key of test_xy_routing_key. It does not send the message to test_xy directly (which is not possible). Without binding, the exchange just drops unroutable messages. Don't know exactly how to bind in Python, but watch out for a method queue_bind. Gerd > > ---------------------------------------------------------------------- > #!/usr/bin/python > > import pika > > connection = pika.BlockingConnection(pika.ConnectionParameters( > 'localhost')) > channel = connection.channel() > > channel.queue_declare(queue='test_xy') > > def callback(ch, method, properties, body): > print " [x] Received %r" % (body,) > > channel.basic_consume(callback, > queue='test_xy', > no_ack=True) > > print ' [*] Waiting for messages. To exit press CTRL+C' > channel.start_consuming() > ---------------------------------------------------------------------- > > Rich. > > -- > Richard Jones > Red Hat > -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de Creator of GODI and camlcity.org. Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de *** Searching for new projects! Need consulting for system *** programming in Ocaml? Gerd Stolpmann can help you. ------------------------------------------------------------