简体   繁体   中英

Sending and receiving messages using AMQP library in python

I've find a official python client for AMQP protocol. Here is the link: https://pypi.python.org/pypi/amqp/

But I can't find any exact examples of how to implement the same. I've read it's documentations from here: https://amqp.readthedocs.io/en/master/_modules/amqp/connection.html#Connection

From the docs, I've tried following code:

import amqp.connection as connection
connection.Connection.collect()

But it asks for some callback as mentioned in docs. So how to figure out the callback?

Can anyone just post an example of sending and receiving messages to and from any public server? Any help would be appreciated.

I've tried to Google for the same but can't find any exact examples. Thank you.

I'm not familiar with the library, but it seems it was forked from amqplib, so some of the instructions in the amqplib might still apply: see https://github.com/barryp/py-amqplib/blob/master/docs/overview.txt .

I also found this gist which might help: https://gist.github.com/nathanborror/109521/a4e9c5ba349cc7bb965c1092c6ea124a6c9e65d7

If you have any question on how to use the library, it might be a good idea to create an issue on the GitHub repo asking for help - they might appreciate the feedback.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM