Ejemplo n.º 1
0
 def declare_exchange(self, xp):
     if xp == "events":
         ex_name = self.mgmt_cfg["events_xp"]
     else:
         ex_name = self.mgmt_cfg["system_exchange"]
     cmd_str = '{0} declare exchange name="{1}" durable=false auto_delete=true type=topic'.format(self.call_args, ex_name)
     (options, args) = self.parser.parse_args(shlex.split(cmd_str))
     mgmt = Management(options, args[1:])
     mgmt.invoke_declare()
Ejemplo n.º 2
0
 def declare_exchange(self, xp):
     if xp == "events":
         ex_name = self.mgmt_cfg["events_xp"]
     else:
         ex_name = self.mgmt_cfg["system_exchange"]
     cmd_str = '{0} declare exchange name="{1}" durable=false auto_delete=true type=topic'.format(
         self.call_args, ex_name)
     (options, args) = self.parser.parse_args(shlex.split(cmd_str))
     mgmt = Management(options, args[1:])
     mgmt.invoke_declare()
Ejemplo n.º 3
0
    def declare_queue(self, xp, queue_name):
        if xp == "events":
            ex_name = self.mgmt_cfg["events_xp"]
        else:
            ex_name = self.mgmt_cfg["system_exchange"]

        if queue_name.startswith(self.sysname):
            qqueue_name = queue_name
        else:
            qqueue_name = ".".join([ex_name, queue_name])

        cmd_str = '{0} declare queue name="{1}" durable=false auto_delete=false'.format(self.call_args, qqueue_name)
        (options, args) = self.parser.parse_args(shlex.split(cmd_str))
        mgmt = Management(options, args[1:])
        mgmt.invoke_declare()
Ejemplo n.º 4
0
    def bind_queue(self, xp, queue_name, binding):
        if xp == "events":
            ex_name = self.mgmt_cfg["events_xp"]
        else:
            ex_name = self.mgmt_cfg["system_exchange"]

        if queue_name.startswith(self.sysname):
            qqueue_name = queue_name
        else:
            qqueue_name = ".".join([ex_name, queue_name])

        cmd_str = '{0} declare binding source="{1}" destination="{2}" destination_type=queue routing_key="{3}"'.format(
            self.call_args, ex_name, qqueue_name, binding)
        (options, args) = self.parser.parse_args(shlex.split(cmd_str))
        mgmt = Management(options, args[1:])
        mgmt.invoke_declare()
Ejemplo n.º 5
0
    def declare_queue(self, xp, queue_name):
        if xp == "events":
            ex_name = self.mgmt_cfg["events_xp"]
        else:
            ex_name = self.mgmt_cfg["system_exchange"]

        if queue_name.startswith(self.sysname):
            qqueue_name = queue_name
        else:
            qqueue_name = ".".join([ex_name, queue_name])

        cmd_str = '{0} declare queue name="{1}" durable=false auto_delete=false'.format(
            self.call_args, qqueue_name)
        (options, args) = self.parser.parse_args(shlex.split(cmd_str))
        mgmt = Management(options, args[1:])
        mgmt.invoke_declare()
Ejemplo n.º 6
0
    def bind_queue(self, xp, queue_name, binding):
        if xp == "events":
            ex_name = self.mgmt_cfg["events_xp"]
        else:
            ex_name = self.mgmt_cfg["system_exchange"]

        if queue_name.startswith(self.sysname):
            qqueue_name = queue_name
        else:
            qqueue_name = ".".join([ex_name, queue_name])

        cmd_str = '{0} declare binding source="{1}" destination="{2}" destination_type=queue routing_key="{3}"'.format(
                self.call_args, ex_name, qqueue_name, binding)
        (options, args) = self.parser.parse_args(shlex.split(cmd_str))
        mgmt = Management(options, args[1:])
        mgmt.invoke_declare()