from kombu import Connection rabbitmq_url = "amqp://guest:guest@localhost//" with Connection(rabbitmq_url) as conn: try: conn.connect() print("RabbitMQ connection successful!") except Exception as e: print(f"Failed to connect: {e}")