Commit bd4f4576 by Guba Sándor

client: adding virtual_host option

parent d0d3b6be
...@@ -22,6 +22,7 @@ class Client: ...@@ -22,6 +22,7 @@ class Client:
self.amqp_user = str(config["amqp_user"]) self.amqp_user = str(config["amqp_user"])
self.amqp_pass = str(config["amqp_pass"]) self.amqp_pass = str(config["amqp_pass"])
self.amqp_queue = str(config["amqp_queue"]) self.amqp_queue = str(config["amqp_queue"])
self.amqp_virtual_host = str(config["amqp_virtual_host"])
def __connect(self): def __connect(self):
""" """
...@@ -33,6 +34,7 @@ class Client: ...@@ -33,6 +34,7 @@ class Client:
self.connection = pika.BlockingConnection(pika.ConnectionParameters( self.connection = pika.BlockingConnection(pika.ConnectionParameters(
host=self.server_address, host=self.server_address,
port=self.server_port, port=self.server_port,
virtual_host=self.amqp_virtual_host,
credentials=credentials credentials=credentials
) )
) )
......
...@@ -13,6 +13,7 @@ def importConf(path_to_file): ...@@ -13,6 +13,7 @@ def importConf(path_to_file):
params["amqp_queue"] = config.get("AMQP" , "Queue") params["amqp_queue"] = config.get("AMQP" , "Queue")
params["amqp_user"] = config.get("AMQP" , "User") params["amqp_user"] = config.get("AMQP" , "User")
params["amqp_pass"] = config.get("AMQP" , "Pass") params["amqp_pass"] = config.get("AMQP" , "Pass")
params["amqp_virtual_host"] = config.get("AMQP" , "Vhost")
metrics["cpu.usage"] = config.get("Metrics", "cpuUsage") metrics["cpu.usage"] = config.get("Metrics", "cpuUsage")
metrics["memory.usage"] = config.get("Metrics", "memoryUsage") metrics["memory.usage"] = config.get("Metrics", "memoryUsage")
metrics["user.count"] = config.get("Metrics", "userCount") metrics["user.count"] = config.get("Metrics", "userCount")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment