You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2009/03/19 15:45:22 UTC

svn commit: r756033 - /qpid/trunk/qpid/python/commands/qpid-config

Author: tross
Date: Thu Mar 19 14:45:21 2009
New Revision: 756033

URL: http://svn.apache.org/viewvc?rev=756033&view=rev
Log:
QPID-1758  Applied qpid-config patch from Ffrench Mathilde.

Modified:
    qpid/trunk/qpid/python/commands/qpid-config

Modified: qpid/trunk/qpid/python/commands/qpid-config
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/commands/qpid-config?rev=756033&r1=756032&r2=756033&view=diff
==============================================================================
--- qpid/trunk/qpid/python/commands/qpid-config (original)
+++ qpid/trunk/qpid/python/commands/qpid-config Thu Mar 19 14:45:21 2009
@@ -27,8 +27,12 @@
 
 _recursive         = False
 _host              = "localhost"
+_altern_ex         = None
+_passive           = False
 _durable           = False
 _clusterDurable    = False
+_if_empty          = True
+_if_unused         = True
 _fileCount         = 8
 _fileSize          = 24
 _maxQueueSize      = None
@@ -58,7 +62,7 @@
     print "        qpid-config [OPTIONS] add exchange <type> <name> [AddExchangeOptions]"
     print "        qpid-config [OPTIONS] del exchange <name>"
     print "        qpid-config [OPTIONS] add queue <name> [AddQueueOptions]"
-    print "        qpid-config [OPTIONS] del queue <name>"
+    print "        qpid-config [OPTIONS] del queue <name> [DelQueueOptions]"
     print "        qpid-config [OPTIONS] bind   <exchange-name> <queue-name> [binding-key]"
     print "        qpid-config [OPTIONS] unbind <exchange-name> <queue-name> [binding-key]"
     print
@@ -69,6 +73,13 @@
     print "         ex:  localhost, 10.1.1.7:10000, broker-host:10000, guest/guest@localhost"
     print
     print "Add Queue Options:"
+    print "    --altern-ex [name of the alternate exchange]"
+    print "                         The alternate-exchange field specifies how messages on this queue should"
+    print "                         be treated when they are rejected by a subscriber, or when they are"
+    print "                         orphaned by queue deletion. When present, rejected or orphaned messages"
+    print "                         MUST be routed to the alternate-exchange. In all cases the messages MUST"
+    print "                         be removed from the queue."
+    print "    --passive            Do not actually change the broker state (queue will not be created)"
     print "    --durable            Queue is durable"
     print "    --cluster-durable    Queue becomes durable if there is only one functioning cluster node"
     print "    --file-count N (8)   Number of files in queue's persistence journal"
@@ -92,7 +103,20 @@
     print "                         registered listeners (e.g. for replication). If set to 2, events will be"
     print "                         generated for enqueues and dequeues"
     print
+    print "Del Queue Options:"
+    print "    --force               Force delete of queue even if it's currently used or it's not empty"
+    print "    --force-if-not-empty  Force delete of queue even if it's not empty"
+    print "    --force-if-used       Force delete of queue even if it's currently used"
+    print
     print "Add Exchange Options:"
+    print "    --altern-ex [name of the alternate exchange]"
+    print "                 In the event that a message cannot be routed, this is the name of the exchange to"
+    print "                 which the message will be sent. Messages transferred using message.transfer will"
+    print "                 be routed to the alternate-exchange only if they are sent with the \"none\""
+    print "                 accept-mode, and the discard-unroutable delivery property is set to false, and"
+    print "                 there is no queue to route to for the given message according to the bindings"
+    print "                 on this exchange."
+    print "    --passive    Do not actually change teh broker state (exchange will not be created)"
     print "    --durable    Exchange is durable"
     print "    --sequence   Exchange will insert a 'qpid.msg_sequence' field in the message header"
     print "                 with a value that increments for each message forwarded."
@@ -241,7 +265,10 @@
             declArgs[MSG_SEQUENCE] = 1
         if _ive:
             declArgs[IVE] = 1
-        self.broker.getAmqpSession().exchange_declare (exchange=ename, type=etype, durable=_durable, arguments=declArgs)
+        if _altern_ex != None:
+            self.broker.getAmqpSession().exchange_declare (exchange=ename, type=etype, alternate_exchange=_altern_ex, passive=_passive, durable=_durable, arguments=declArgs)
+        else:
+            self.broker.getAmqpSession().exchange_declare (exchange=ename, type=etype, passive=_passive, durable=_durable, arguments=declArgs)
 
     def DelExchange (self, args):
         if len (args) < 1:
@@ -286,13 +313,16 @@
         if _eventGeneration:
             declArgs[QUEUE_EVENT_GENERATION]  = _eventGeneration
 
-        self.broker.getAmqpSession().queue_declare (queue=qname, durable=_durable, arguments=declArgs)
+        if _altern_ex != None:
+            self.broker.getAmqpSession().queue_declare (queue=qname, alternate_exchange=_altern_ex, passive=_passive, durable=_durable, arguments=declArgs)
+        else:
+            self.broker.getAmqpSession().queue_declare (queue=qname, passive=_passive, durable=_durable, arguments=declArgs)
 
     def DelQueue (self, args):
         if len (args) < 1:
             Usage ()
         qname = args[0]
-        self.broker.getAmqpSession().queue_delete (queue=qname)
+        self.broker.getAmqpSession().queue_delete (queue=qname, if_empty=_if_empty, if_unused=_if_unused)
 
     def Bind (self, args):
         if len (args) < 2:
@@ -340,7 +370,8 @@
 try:
     longOpts = ("durable", "cluster-durable", "bindings", "broker-addr=", "file-count=",
                 "file-size=", "max-queue-size=", "max-queue-count=", "limit-policy=",
-                "order=", "sequence", "ive", "generate-queue-events=")
+                "order=", "sequence", "ive", "generate-queue-events=", "force", "force-if-not-empty",
+                "force_if_used", "altern_ex=", "passive")
     (optlist, encArgs) = getopt.gnu_getopt (sys.argv[1:], "a:b", longOpts)
 except:
     Usage ()
@@ -356,6 +387,10 @@
         _recursive = True
     if opt[0] == "-a" or opt[0] == "--broker-addr":
         _host = opt[1]
+    if opt[0] == "--altern-ex":
+        _altern_ex = opt[1]
+    if opt[0] == "--passive":
+        _passive = True
     if opt[0] == "--durable":
         _durable = True
     if opt[0] == "--cluster-durable":
@@ -384,6 +419,14 @@
         _ive = True
     if opt[0] == "--generate-queue-events":
         _eventGeneration = int (opt[1])
+    if opt[0] == "--force":
+        _if_empty  = False
+        _if_unused = False
+    if opt[0] == "--force-if-not-empty":
+        _if_empty  = False
+    if opt[0] == "--force-if-used":
+        _if_unused = False
+    
 
 nargs = len (cargs)
 bm    = BrokerManager ()



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org