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

Shambhu
Shambhu Member Posts: 4

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: 268 Solace Employee

    Can you provide error messages for your various attempts?

  • Shambhu
    Shambhu Member Posts: 4
    edited August 2023 #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

  • Shambhu
    Shambhu Member Posts: 4

    @Aaron @marc @amackenzie , Not getting any solution of the above issue, event I checked in with no firewall setting. And not getting any clue why the session creation is failing. Would be great if you provide as code snippet. The git sample program is giving issue in creating session in debug mode.

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

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

    Hi @Shambhu,

    Unfortunately that error doesn't give us obvious next steps. Have you opened a support ticket yet? They will be able to privately chat about your environment details and find a resolution.

    Sorry I couldn't be more helpful!

  • nomassama
    nomassama Member Posts: 11 ✭✭

    @Shamhu Did you guys resolve this, I am getting the same error