Jul 082014

Man, this was driving me nuts. Using identical code as successful queue/topic receive operations against the Azure Service Bus, I was perplexed to see “no valid sources” as if my broker address was wrong. I checked it repeatedly, and started doubting that I had the wrong broker settings.

In the end, it was the SAS policy key. Azure generates a healthily-long key. This was the first one I got that  had / (slash) and + (plus) characters in the key. As this key is part of the URI Qpid Proton uses to connect to the broker, it needs to be URL-encoded. Simple enough to fix in python:

import urllib
sasPolicyKey = "<your key from Azure with slashes and/or plus signs>"
safeSasPolicyKey = urllib.quote(sasPolicyKey, "")

  One Response to “proton.MessengerException "no valid sources"”

  1. It was driving me nuts as well, trying to use the proton-c C clients. Much thanks indeed.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>