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

use of channel.queue_declare() in reader_example.py forces user to have conf permissions for exchange #3

Open
kript opened this issue Jul 24, 2017 · 1 comment

Comments

@kript
Copy link

kript commented Jul 24, 2017

The line
channel.queue_declare(queue = 'Finish')
registers the queue within the default exchange, if it doesn't already exist.

Suggest changing

    channel.queue_declare(queue='Finish')
    channel.basic_publish(exchange='',
                          routing_key='Finish',
                          body=json.dumps(datadict))

inlsf_log_watch.py
to something like

channel.queue_bind(exchange='LSF',
                   queue=queue_name)
    channel.queue_declare(queue='Finish')
    channel.basic_publish(exchange='LSF',
                          routing_key='Finish',
                          body=json.dumps(datadict))

and likewise in reader_example.py, removing the line
channel.queue_declare(queue = 'Finish')
and changing

    channel.basic_consume(callback,
                          queue='Finish',
                          no_ack=True)

to

channel.queue_bind(exchange='LSF',
                   queue=queue_name)
    channel.basic_consume(callback,
                          queue='Finish',
                          no_ack=True)
@PeteClapham
Copy link
Contributor

Happy with the option, this looks pretty sane and may add more options for later use.

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