private void PublisherAuthorized() { var endPoint = ServerEndPoint.WithCredentials( Defaults.Address, Defaults.Port, userName: "******", password: "******", secured: false ); ClientOptions opts = ConnectionUtils.GetDefaultOptions(); opts.AddServer(endPoint); ConnectionFactory cf = new ConnectionFactory(); using (IConnection conn = cf.CreateConnection(opts)) { //sends a single message having a string as payload Console.WriteLine("Authorized is publishing..."); conn.Publish( new MsgIn("The.Target").SetPayload("the message"), CancellationToken.None ); } }