jamesnetherton opened a new issue, #9520:
URL: https://github.com/apache/camel-quarkus/issues/9520

   The tls-registry extension restarts every Camel route when a certificate is 
reloaded.
   
   ### Current behaviour
   
   - `TlsCertificateReloadObserver` reacts to every `CertificateUpdatedEvent`, 
including events for TLS configurations that no Camel component uses.
   - For each event it binds a new `SSLContextParameters` bean in the registry 
and schedules `DefaultContextReloadStrategy.onReload`. That reloads properties, 
component properties and secrets, then calls `reloadAllRoutes()`, which removes 
every route, clears the endpoint registry and starts all routes again from the 
model.
   - Quarkus fires `CertificateUpdatedEvent` on every 
`quarkus.tls.reload-period` tick whenever the files load, whether or not they 
changed. So every route restarts once per period. If the period is shorter than 
`reload-certificate-delay`, each event resets the debounce timer and the reload 
never runs.
   - `TlsRegistryRecorder` installs `DefaultContextReloadStrategy` whenever 
`reload-on-certificate-update=true` (the default), even without 
`reload-period`. That also enables context reloads triggered over JMX.
   - Rebinding the bean doesn't reach endpoints or components, which keep the 
instance they resolved at creation.
   - Components that build their own key managers from `getKeyManagers()`, such 
as camel-vertx-http, use a key store copy that is made once per bean and never 
refreshed.
   - TLS session resumption can let a connection keep using the previous 
certificates after a reload.
   
   ### Proposal
   
   - Bridged beans serve key and trust material through key and trust managers 
that follow a reload. Components that use `createSSLContext()` pick up the new 
material on new connections without a restart. Session caches of the contexts 
handed out are invalidated when the material changes.
   - Detect real changes by fingerprinting the key and trust material, and 
ignore events where nothing changed. Debounce only changed configurations.
   - Stop rebinding beans, and remove the `DefaultContextReloadStrategy` 
installation.
   - When `reload-on-certificate-update=true`:
     - Restart in place only the endpoints that hold a copy of changed 
material, plus the routes that consume from them or send to them statically. 
Restore each route's previous state (started, suspended or stopped).
     - When the trust material changes, restart every endpoint using the bean. 
A server otherwise keeps accepting session tickets from clients that are no 
longer trusted.
   - Document what is reloaded live, when routes restart and the known limits, 
and add a migration guide entry.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to