* [Caml-list] [ANN] Netamqp, a client for AMQP-0-9-1 @ 2011-03-28 14:03 Gerd Stolpmann 2011-09-19 17:08 ` Richard W.M. Jones 0 siblings, 1 reply; 4+ messages in thread From: Gerd Stolpmann @ 2011-03-28 14:03 UTC (permalink / raw) To: caml-list Hi, 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. Message queues are another way of establishing communication paths between independent processes. The nice aspect about this architecture is that message queues form a store-and-forward network: Each participant is only a client of the central store, and is not required to permanently check for the arrival of input. Messages arriving when the client cannot pay attention are preserved in the queue. This makes message queue networks very robust and easy to operate. The downside is that there is a single point of failure, namely the queue server. Messages are just strings of any length. AMQP does not attempt to define a serialization format. The Netamqp client allows synchronous and asynchronous message processing, the latter with the help of Ocamlnet's event loop. The homepage is at: http://oss.wink.com/netamqp/. See there for download links, and the online manual. There is a GODI package for Ocaml 3.12: godi-netamqp. Gerd -- ------------------------------------------------------------ Gerd Stolpmann, Bad Nauheimer Str.3, 64289 Darmstadt,Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de Phone: +49-6151-153855 Fax: +49-6151-997714 ------------------------------------------------------------ ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] [ANN] Netamqp, a client for AMQP-0-9-1 2011-03-28 14:03 [Caml-list] [ANN] Netamqp, a client for AMQP-0-9-1 Gerd Stolpmann @ 2011-09-19 17:08 ` Richard W.M. Jones 2011-09-20 10:26 ` Gerd Stolpmann 0 siblings, 1 reply; 4+ messages in thread From: Richard W.M. Jones @ 2011-09-19 17:08 UTC (permalink / raw) To: Gerd Stolpmann; +Cc: caml-list 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? 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. ---------------------------------------------------------------------- #!/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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] [ANN] Netamqp, a client for AMQP-0-9-1 2011-09-19 17:08 ` Richard W.M. Jones @ 2011-09-20 10:26 ` Gerd Stolpmann 2011-09-20 11:46 ` Richard W.M. Jones 0 siblings, 1 reply; 4+ messages in thread From: Gerd Stolpmann @ 2011-09-20 10:26 UTC (permalink / raw) To: Richard W.M. Jones; +Cc: caml-list 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. ------------------------------------------------------------ ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] [ANN] Netamqp, a client for AMQP-0-9-1 2011-09-20 10:26 ` Gerd Stolpmann @ 2011-09-20 11:46 ` Richard W.M. Jones 0 siblings, 0 replies; 4+ messages in thread From: Richard W.M. Jones @ 2011-09-20 11:46 UTC (permalink / raw) To: Gerd Stolpmann; +Cc: caml-list On Tue, Sep 20, 2011 at 12:26:15PM +0200, Gerd Stolpmann wrote: > 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. Thanks, that works. For future reference, below is the full working receiver. Rich. ---------------------------------------------------------------------- #!/usr/bin/python import pika connection = pika.BlockingConnection(pika.ConnectionParameters( 'localhost')) channel = connection.channel() channel.queue_declare(queue='test_xy') channel.queue_bind(exchange='amq.direct', queue='test_xy', routing_key='test_xy_routing_key') 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() ---------------------------------------------------------------------- -- Richard Jones Red Hat ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-09-20 11:46 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2011-03-28 14:03 [Caml-list] [ANN] Netamqp, a client for AMQP-0-9-1 Gerd Stolpmann 2011-09-19 17:08 ` Richard W.M. Jones 2011-09-20 10:26 ` Gerd Stolpmann 2011-09-20 11:46 ` Richard W.M. Jones
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox