Encountered sasl exception when connecting to Solace topic with AMQPLite dotnet library(AMQP 1.0)

grantli Member Posts: 1
edited February 1 in PubSub+ Event Broker #1
Hello everyone,

I am suffering an error when I tried to send/publish the messages with AMQP in my C# code.
Below is the error:

Below is the partial code, the Connect() method is an internal method which is responsible for creating a AMQP connection session and connecting to Solace.

The exception was thrown from this method.

public void Send(string text)
var sender = new Amqp.SenderLink(session, BrokerQueue);

It looks like something wrong related to SASL when connecting to the Solace host.
I am using non-secure amqp static connection string like below.
amqp://default:default@<My Solace host>:5673/<My Message VPN>

5673 is the port number that my host is exposing for AMQP protocol.
I am sure my code works because when I changed it to connect to the Azure Service bus queue, it did work.
Not sure how I can do to fix the issue, will be really appreciate if I get any clues, thanks!


  • marc
    marc Member, Administrator, Moderator, Employee Posts: 898 admin

    Hi @grantli ,

    Did you verify that ANONYMOUS mechanism is correct for your broker config? If you are using username/password then you likely need to use PLAIN. This is from the solace docs here: 

    AMQP uses the Simple Authentication and Security Layer (SASL) for authentication. The event broker supports ANONYMOUS, PLAIN, and EXTERNAL SASL mechanisms.

    The ANONYMOUS mechanism must be used for the Solace basic authentication type of none.

    The PLAIN mechanism must be used for Solace basic authentication types of internal, ldap, or radius. In this case the authcid and password fields of the sasl.init frame are used to establish identity.

    The EXTERNAL mechanism must be used for Solace client-certificate authentication. In this case the identity is established through the fields of the provided client certificate in the normal manner. https://docs.solace.com/API/AMQP/Client-Support.htm

    Hope that helps!