celery/kombu — pull request #410 by beav (2014-09-19 16:41:30+00:00)
Title: Allow ANONYMOUS sasl_mechanism by default

Previously, kombu supported the `PLAIN` sasl_mechanism out of the box. This does not match with Qpid, which supports only `ANONYMOUS` out of the box[1].

This patch changes the default behavior to try `PLAIN` first, and then to retry with `ANONYMOUS` if authentication via the first method fails. There are a few differences in the way qpid.messaging selects the best SASL mechanism, which can be surprising to users if they have different packages installed[2]. This patch works around these by sorting the sasl_mechanism list so `ANONYMOUS` is last, and then trying each mechanism individually for a connection instead of passing a full list of mechanisms and allowing qpid.messaging (and possibly saslwrapper) to choose.

[1] https://issues.apache.org/jira/browse/QPID-6091
[2] https://issues.apache.org/jira/browse/QPID-6109