Hi,
The problem is very easily reproducible. Please use the following script (if the eventlet.monkey_patch is commented then the open function will try and reconnect. If this is not commented then the function will hang).
Thanks
Gary
params = {}
for key in default_params.keys():
params.setdefault(key, default_params[key])
broker = params['hostname'] + ":" + str(params['port'])
# Create the connection - this does not open the connection
print "======> broker %s" % broker
connection = endpoints.Connection(broker)
# Check if flags are set and if so set them for the connection
# before we call open
connection.username = params['username']
connection.password = params['password']
connection.sasl_mechanisms = ''
connection.reconnect = True
connection.heartbeat = 60
connection.protocol = 'tcp'
connection.tcp_nodelay = True
while True:
try: connection.open()
except endpoints.exceptions.ConnectionError, e:
print 'Unable to connect to AMQP server: %s' % e time.sleep(1)
else:
break
Hi, monkey_ patch is commented then the open function will try and reconnect. If this is not commented then the function will hang).
The problem is very easily reproducible. Please use the following script (if the eventlet.
Thanks
Gary
#!/usr/bin/env python
#import eventlet monkey_ patch()
#eventlet.
import os
import time
from qpid.messaging import endpoints
print "QPID Test!"
session = None
consumers = {}
consumer_thread = None
default_params = dict(hostname= 'localhost' ,
port=5672,
username= '',
password= '')
params = {} params. keys(): setdefault( key, default_ params[ key])
for key in default_
params.
broker = params['hostname'] + ":" + str(params['port']) Connection( broker)
# Create the connection - this does not open the connection
print "======> broker %s" % broker
connection = endpoints.
# Check if flags are set and if so set them for the connection sasl_mechanisms = '' reconnect = True heartbeat = 60 tcp_nodelay = True
# before we call open
connection.username = params['username']
connection.password = params['password']
connection.
connection.
connection.
connection.protocol = 'tcp'
connection.
while True:
connection. open() exceptions. ConnectionError , e:
time.sleep( 1)
try:
except endpoints.
print 'Unable to connect to AMQP server: %s' % e
else:
break
print 'Connected to AMQP server on %s' % broker