Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing to a non-existing exchange does not raise errors #221

Open
greatvovan opened this issue Jul 20, 2020 · 1 comment
Open

Publishing to a non-existing exchange does not raise errors #221

greatvovan opened this issue Jul 20, 2020 · 1 comment

Comments

@greatvovan
Copy link

When publishing to a non-existing exchange the module does not raise any exceptions, but any subsequent operation on the channel will raise exceptions.

This code completes without problems, but will throw if uncommented:

import asyncio
import aioamqp

async def main():
    tr, pr = await aioamqp.from_url('amqp://log:pass@host')
    chan = await pr.channel()
    await chan.publish(b'ABC', 'no-such-exchange', '')
    # await chan.publish(b'ABC', 'no-such-exchange', '')
    # await chan.close()
    tr.close()
    await asyncio.sleep(1.0)

asyncio.run(main())

Expected: an exception is raised at the moment of problem operation.

aioamqp==0.14.0
Python 3.8.0

@dzen
Copy link
Contributor

dzen commented Aug 10, 2020

Hi @greatvovan

it's because of AMQP design : the publish does not raises any error, but any operations fails thereafter

https://stackoverflow.com/questions/56550352/python-pika-publishing-to-non-existing-exchange-does-not-raise-exception

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants