File tree Expand file tree Collapse file tree
proxy/src/main/java/org/apache/rocketmq/proxy Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ public class ProxyConfig implements ConfigFile {
8383 private boolean tlsTestModeEnable = true ;
8484 private String tlsKeyPath = ConfigurationManager .getProxyHome () + "/conf/tls/rocketmq.key" ;
8585 private String tlsCertPath = ConfigurationManager .getProxyHome () + "/conf/tls/rocketmq.crt" ;
86+ private int tlsCertWatchIntervalMs = 60 * 60 * 1000 ; // 1 hour
8687 /**
8788 * gRPC
8889 */
@@ -325,6 +326,14 @@ public void parseDelayLevel() {
325326 }
326327 }
327328
329+ public int getTlsCertWatchIntervalMs () {
330+ return tlsCertWatchIntervalMs ;
331+ }
332+
333+ public void setTlsCertWatchIntervalMs (int tlsCertWatchIntervalMs ) {
334+ this .tlsCertWatchIntervalMs = tlsCertWatchIntervalMs ;
335+ }
336+
328337 public String getRocketMQClusterName () {
329338 return rocketMQClusterName ;
330339 }
Original file line number Diff line number Diff line change 1515 * limitations under the License.
1616 */
1717package org .apache .rocketmq .proxy .service .cert ;
18+
1819import org .apache .rocketmq .common .constant .LoggerName ;
1920import org .apache .rocketmq .common .utils .StartAndShutdown ;
2021import org .apache .rocketmq .logging .org .slf4j .Logger ;
@@ -39,7 +40,7 @@ public TlsCertificateManager() {
3940 ConfigurationManager .getProxyConfig ().getTlsKeyPath ()
4041 },
4142 new CertKeyFileWatchListener (),
42- 60 * 60 * 1000 /* 1 hour */
43+ ConfigurationManager . getProxyConfig (). getTlsCertWatchIntervalMs ()
4344 );
4445 } catch (Exception e ) {
4546 log .error ("Failed to initialize TLS certificate watch service" , e );
@@ -107,7 +108,7 @@ private void notifyContextReload() {
107108 for (TlsContextReloadListener listener : reloadListeners ) {
108109 try {
109110 listener .onTlsContextReload ();
110- } catch (Exception e ) {
111+ } catch (Throwable e ) {
111112 log .error ("Failed to notify TLS context reload to listener: " + listener , e );
112113 }
113114 }
You can’t perform that action at this time.
0 commit comments