Skip to content

Instantly share code, notes, and snippets.

@robmadden
Created November 20, 2013 18:43
Show Gist options
  • Save robmadden/7568640 to your computer and use it in GitHub Desktop.
Save robmadden/7568640 to your computer and use it in GitHub Desktop.
ActiveMQ Client
SERVER1 = 'X.X.X.X' SERVER2 = 'X.X.X.X' PORT = XXXXX client = PublishClient(SERVER1, ACTIVEMQ_PORT)
ip_dest = '' activemq_ip = SERVER1
try: response = client.connect(USER, PASSWORD) activemq_ip = SERVER1 except Exception as e: client = PublishClient(SERVER2, PORT)
try: response = client.connect(USER, PASSWORD) activemq_ip = SERVER2 except Exception as e: if (mq_params['count'] == 0):
print "Could not connect to activemq." time.sleep(3) mq_params['count'] += 1 self.send(mq_params)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment