bynder / qpid-bow Goto Github PK
View Code? Open in Web Editor NEWQpid Bow is a higher level client framework for Python 3.6+ to communicate with AMQP/Qpid servers combined with a set of CLI tools to manage a Qpid server.
License: MIT License
Qpid Bow is a higher level client framework for Python 3.6+ to communicate with AMQP/Qpid servers combined with a set of CLI tools to manage a Qpid server.
License: MIT License
This is the last version prior to completely rewriting the IO in Python rather than using C as the pinned 0.24 version does.
Doing this will enable us to know if qpid-bow is using any symbols that are no longer exported by the library. And we can take some action to fix this.
Due to some last minute breakage, the 0.28 release (the version after the IO rewrite) is known not to work with external loops - This is PROTON-2051
Lines 192 to 200 in 60874a2
AFAICT, this always returns a Future and will always test as successful.
Is there a non-async, basic, recieve() method? I am not in a good position to add another event loop the the program I am modifying, am just looking to poll for message(s) from AQMP queues.
Reading the code it looks like Receiver.receive(timeout) should run the event for timeout's duration and return, which would be fine. But it does not receive messages when I run it.
async def consumer(message: Message) -> bool:
print(f'Received message: {message.body}')
return True
class QpidClient:
def __init__(self, queue_name : str, reply_queue_name : str, server_address = '127.0.0.1'):
if queue_name is None or len(queue_name) == 0 or reply_queue_name is None or len(reply_queue_name) == 0:
raise Exception('QpidClient: queue_name and reply_queue_name must be strings.')
self.server_url = server_address
self.queue_name = queue_name
self.timeout = timedelta(seconds=5)
self.reply_sender = Sender(server_url=server_address)
self.reply_queue_name = reply_queue_name
if not self.try_create_queues():
raise Exception('QpidClient: could not create queues ', self.queue_name, ' and ', reply_queue_name)
def try_create_queues(self):
rtn = True
try:
create_queue(self.queue_name, priorities=10, server_url=self.server_url)
except QMF2ObjectExists:
print('Queue already exists:', self.queue_name)
# pass # Queue already exists
except QMF2Exception:
print("QMF2 error during queue creation")
rtn = False
try:
create_queue(self.reply_queue_name, priorities=10, server_url=self.server_url)
except QMF2ObjectExists:
print('Queue already exists:', self.reply_queue_name)
# pass # Queue already exists
except QMF2Exception:
print("QMF2 error during queue creation")
rtn = False
return rtn
def send_messages(self, message_to_send = []):
sender = Sender(self.queue_name, self.server_url)
messages = []
for msg in message_to_send:
message = create_message(msg)
message.address = self.queue_name
message.reply_to = self.reply_queue_name
messages.append(message)
print('message', msg)
sender.queue(messages)
sender.send()
# This should? spend timeout seconds trying to get messages.
def recv_messages_async(self, messages_recieved = [], message_count_limit=1):
# >>>> These three lines receive all the queued messages, but then execution is blocked in loop.run_forever()
#receiver.run()
#loop = asyncio.get_event_loop()
#loop.run_forever()
# >>>> These two lines receive nothing even when there are enqueued messages.
receiver = Receiver(consumer, self.queue_name, self.server_url, container_class=AsyncioContainer)
receiver.receive( timeout=timedelta(0, 1, 0, 0, 0, 0, 0,) )
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.