We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
pyamqp==5.1.1
I used below sample code for testing. If set heartbeat, the connection will be killed by rabbitmq server.
If disable heartbeat by set zero value, the code works very well.
Seems pyamqp won't send heartbeat automatically.
But if no heartbeat the rabbitmq won't close died connections, it cause server performance if too many dided connections.
import amqp import time import logging def _on_message(*args, **kwargs): pass def main(): connection = amqp.Connection(host = 'xxx.xxx.xxx.xxx:5672', heartbeat = 3, userid="xxx", password="xxx") connection.connect() channel = connection.channel() queue = channel.queue_declare(queue = 'myqueue', durable = False, auto_delete = False) queue_name = queue.queue channel.exchange_declare('myex', type='direct', durable = False, auto_delete = False) channel.queue_bind(queue_name, 'myex', 'myroutingkey') channel.basic_qos(prefetch_size = 0, prefetch_count = 2, a_global = False) channel.basic_consume(callback = _on_message, queue = queue_name) print("xxxxxxxxxxxxxxxxxxxxxx") try: while True: connection.drain_events() time.sleep(0.5) except KeyboardInterrupt: logging.info("Python service stoped...........^v^") # Someone pressed CTRL-C, stop consuming and close except Exception as ex: logging.critical(ex) finally: channel.close() connection.close() main()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
pyamqp==5.1.1
I used below sample code for testing.
If set heartbeat, the connection will be killed by rabbitmq server.
If disable heartbeat by set zero value, the code works very well.
Seems pyamqp won't send heartbeat automatically.
But if no heartbeat the rabbitmq won't close died connections, it cause server performance if too many dided connections.
The text was updated successfully, but these errors were encountered: