Commits

Kyle Schaffrick committed 5cf1bb9

Make parameter order consistent on all publish methods.

Comments (0)

Files changed (1)

             self._queues[q.name] = q
             return q
 
-    def publish(self, routing_key, message, **kwargs):
+    def publish(self, message, routing_key, **kwargs):
         """
         Convenience for publishing on the default direct exchange.
         """
-        return self.exchange('').publish(routing_key, message, **kwargs)
+        return self.exchange('').publish(message, routing_key, **kwargs)
 
     def consume_from(self, *queues, **kwargs):
         """
     def name(self):
         return self._name
 
-    def publish(self, routing_key, message, mandatory=False, immediate=False):
+    def publish(self, message, routing_key="", mandatory=False, immediate=False):
         self._ch.send_method(spec.basic.publish, ticket=0, exchange=self._name,
                 routing_key=routing_key, mandatory=mandatory,
                 immediate=immediate)
         Convenience for publishing to this queue via the default direct
         exchange.
         """
-        return self._bs.publish(self.name, message, **kwargs)
+        return self._bs.publish(message, self.name, **kwargs)
 
     def get(self, no_ack=True):
         rx_m = self._ch.sync_method(spec.basic.get,