steveniemitz commented on PR #21457:
URL: https://github.com/apache/flink/pull/21457#issuecomment-1339532966

   as a concrete example:
   ```
   class ReloadableSslContextSupplier implements Supplier<SslContext> {
   
      private final ReloadableSslContext reloadableSslContext;
      private final FileSystemWatchService fileSystemWatchService;
   
      public ReloadableSslContextSupplier(Configuration config, boolean 
isClient, SslProvider sslProvider) {
         this.reloadableSslContext = <create a ReloadableSslContext somehow>
         this.fileSystemWatchService =
                   new FileSystemWatchService(<path to watch or whatever>) {
                       @Override
                       protected void onFileOrDirectoryModified(Path 
relativePath) {
                           try {
                               LOG.info("Reloading SSL context because of 
certificate change");
                               reloadableSslContext.reload();
                               LOG.info("SSL context reloaded successfully");
                           } catch (Exception e) {
                               LOG.error("SSL context reload received 
exception: " + e);
                           }
                       }
                   };
           fileSystemWatchService.start();
      }
   
      public SslContext get() { 
        return reloadableSslContext;
      }
   }


-- 
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: issues-unsubscr...@flink.apache.org

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

Reply via email to