When trying to send a message from a laptop to another laptop with pika and rabbitmq I get this error. Any ideas how to solve this?
WARNING:pika.adapters.base_connection:Could not connect due to "timeout," retrying in 2 sec
ERROR:pika.adapters.base_connection:Could not connect: timeout
Traceback (most recent call last):
File "C:/Users/Peter/Desktop/Blimp182-development(1)/Blimp182-development/Blimp182/send.py", line 7, in <module>
connection = pika.BlockingConnection(parameters)
File "C:\Python27\lib\site-packages\pika\adapters\base_connection.py", line 61, in __init__
super(BaseConnection, self).__init__(parameters, on_open_callback)
File "C:\Python27\lib\site-packages\pika\connection.py", line 513, in __init__
self._connect()
File "C:\Python27\lib\site-packages\pika\connection.py", line 804, in _connect
self._adapter_connect()
File "C:\Python27\lib\site-packages\pika\adapters\blocking_connection.py", line 138, in _adapter_connect
super(BlockingConnection, self)._adapter_connect()
File "C:\Python27\lib\site-packages\pika\adapters\base_connection.py", line 120, in _adapter_connect
self.params.retry_delay)
pika.exceptions.AMQPConnectionError: 2.0
Process finished with exit code 1
The used code is here:
import pika
import logging
logging.basicConfig()
credentials = pika.PlainCredentials('guest','guest')
parameters = pika.ConnectionParameters('10.43.12.76', 55672, '/', credentials)
connection = pika.BlockingConnection(parameters=parameters)
channel = connection.channel()
channel.queue_declare(queue='hello')
channel.basic_publish(exchange='',
routing_key='hello',
body='Hello World!')
print " [x] Sent 'Hello World!'"
connection.close()