amareshmad commented on issue #114:
URL: 
https://github.com/apache/pulsar-dotpulsar/issues/114#issuecomment-1280725410

   Connection established from product code 
   
   Consumer code:
         await using var client = PulsarClient.Builder()
                                                        .Authentication(new 
AuthenticationBasic(username, password))
                                                        .ServiceUrl(sURl)
                                                        
.ExceptionHandler(pException.OnException)
                                                        
.VerifyCertificateAuthority(false)
                                                        
.TrustedCertificateAuthority(new 
System.Security.Cryptography.X509Certificates.X509Certificate2())
                                                        .Build();
   
                   log.Info($"creating Consumer.......");
                   await using var consumer = 
client.NewConsumer(Schema.ByteArray)
                                                    .Topic(myTopic)             
                               
                                                    
.SubscriptionName(subscriptionName)
                                                    
.SubscriptionType(SubscriptionType.Shared)
                                                    
.StateChangedHandler(DESPulsarQueue.Monitor)
                                                    .Create();
   
   
   producer code:   log.Info($"build producer client");
                   ExceptionHandler pException = new ExceptionHandler();
   
                   await using var client = PulsarClient.Builder()
                                                        .Authentication(new 
AuthenticationBasic(username, password))
                                                        .ServiceUrl(sURl)
                                                        
.ExceptionHandler(pException.OnException)
                                                        
.VerifyCertificateAuthority(false)
                                                        
.TrustedCertificateAuthority(new 
System.Security.Cryptography.X509Certificates.X509Certificate2())
                                                        .Build();
   
                   log.Info($"creating producer.......");
                   await using var producer = client.NewProducer(Schema.String)
                                                    .Topic(myTopic)
                                                    
.StateChangedHandler(Monitor)
                                                    .Create();
   Source helped to setting up TLS layers: 
https://support.avigilon.com/s/article/How-to-Check-if-TLS-1-2-is-Enabled?language=en_US
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to