How to create session with Solace Messaging tcp protocol being in orgnization vpn network.

Shambhu
Shambhu Member Posts: 3

Hi Team,

Session creation is failing while being in organization VPN. so tried with proxy settings as well given in  https://docs.solace.com/API/API-Developer-Guide/Session-Props-Required.htm#Creating_ent_sessions_sess_props_host_dir_con

 but no luck. I tried with multiple debug.

string host = $"tcp://mr-connection-l7ua5omxxxx.messaging.solace.cloud:55555%httpc://rb-proxy-de.bosch.com:8080";
string username = "solace-cloud-client";
string vpnname = "solace1sttryout";
string password = "pflxxxxxxxxxxxxxxxxxxxqp";

      SessionProperties sessionProps = new SessionProperties()
     {                
         Host = host,
         VPNName = VPNName,
         UserName = UserName,
         Password = Password,
         ReconnectRetries = DefaultReconnectRetries,
         SSLValidateCertificate = false,
         //SSLClientCertificateFile = sslFile
     };
     // Connect to the Solace messaging router
     Console.WriteLine("Connecting as {0}@{1} on {2}...", UserName, VPNName, host);
     using (ISession session = context.CreateSession(sessionProps, null, null))
     {
         ReturnCode returnCode = session.Connect();
         if (returnCode == ReturnCode.SOLCLIENT_OK)
         {
             Console.WriteLine("Session successfully connected.");
             PublishMessage(session);
         }
         else
         {
             Console.WriteLine("Error connecting, return code: {0}", returnCode);
         }
     }

tried with without proxy and with proxy both failed.

also tried but no luck.

string host = $"tcps://mr-connection-l7ua5omxxxx.messaging.solace.cloud:55433%httpc://rb-proxy-de.bosch.com:8080";


Answers

  • amackenzie
    amackenzie Member, Employee Posts: 240 Solace Employee

    Can you provide error messages for your various attempts?

  • Shambhu
    Shambhu Member Posts: 3
    edited August 18 #3

    @amackenzie , thanks for picking up the question, error is as below while debugging in c#.net.

    SolaceSystems.Solclient.Messaging.OperationErrorException
    HResult=0x80131500
    Message=Failed to connect session
    Source=SolaceSystems.Solclient.Messaging
    StackTrace:
    at SolaceSystems.Solclient.Utils.Types.Utilities.GuardAgainstFailOrNotReady(ReturnCode returnCode, String message, Boolean includeSdkError, ISolLogger logger)
    at SolaceSystems.Solclient.Messaging.Native.SessionImpl.Connect()
    at Tutorial.TopicPublisher.Run(IContext context, String host) in C:\Users\zzu2kor\git source\ConsoleAppSample\SolaceMessaging\SolaceMessaging\Program.cs:line 86
    at Tutorial.TopicPublisher.Main(String[] args) in C:\Users\zzu2kor\OneDrive - Bosch Group\tryouts\git source\ConsoleAppSample\SolaceMessaging\SolaceMessaging\Program.cs:line 165

    This exception was originally thrown at this call stack:
    [External Code]
    Tutorial.TopicPublisher.Run(SolaceSystems.Solclient.Messaging.IContext, string) in Program.cs
    Tutorial.TopicPublisher.Main(string[]) in Program.cs

    program is taken from https://github.com/SolaceSamples/solace-samples-dotnet/blob/master/src/TopicPublisher/TopicPublisher.cs