Code Monkey home page Code Monkey logo

qpid-bow's Issues

It would help significantly if you could test qpid-bow against qpid-proton 0.27.1

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

Async receive always succeeds

success = asyncio.ensure_future(
self.handle_async_message(event), loop=loop)
else:
success = self.handle_message(event)
if success:
self.accept(event.delivery)
else:
self.reject(event.delivery)

AFAICT, this always returns a Future and will always test as successful.

Non-async recieve?

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,) )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.