lburgazzoli commented on PR #13273:
URL: https://github.com/apache/camel/pull/13273#issuecomment-1962350520

   > This can lead to waiting forever as if the system keeps taking in new 
inflight messages, as this will never issue the shutdown strategy to begin 
shutting down. The shutdown strategy automatic let inflight messages complete 
(it has a timeout of 45 seconds). So with this in mind I think the current way 
should cover this.
   > 
   > What is it that you see that dont work today?
   
   This implementation is meant to explore how to move come logic that exists 
in the camel-k-runtime (the cron support) to camel so we can remove camel-k 
specific logic and have a generic solution. 
   
   What camel-k does is:
   - to let Kubernetes handle job scheduling (leveraging the 
[Job](https://kubernetes.io/docs/concepts/workloads/controllers/job/) resource) 
instead of using the native one so the JVM does not requires to be always up 
and running
   - to let Kubernetes natively handle 
[timeout/deadlines](https://kubernetes.io/docs/concepts/workloads/controllers/job/#job-termination-and-cleanup)
   - to trigger the execution of the route, camel-k replace the scheduling 
component with a 1 shot timer event.
   
   I knew about the shutdown timeout, but given the point above, the 
expectation is that the shutdown is not even triggered till all the task have 
been completed. So theoretically by setting a very high timeout you could 
achieve the same result, but you would see an entry in the log about the 
context being shutting down which may be confusing.
   
   Still I don't really know if my implementation is correct or not, maybe we 
could think about a pluggable hook to let inject custom semantics.
   
   > 
   > Also if something needs to be added then why are the 2 options false and 
true by default, can we not have just one option instead. Camel already have 
too many options and can confuse users.
   
   I first had a single parameter, hover I noticed that the idle task, [take 
into account the inflight 
messages](https://github.com/apache/camel/blob/214ebc1f93790fe60d93d0c1e44fabdf51ae541f/core/camel-main/src/main/java/org/apache/camel/main/MainDurationEventNotifier.java#L248)
 before triggering the shutdown so to preserve the current behavior, I added a 
second option 


-- 
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: commits-unsubscr...@camel.apache.org

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

Reply via email to