[
https://issues.apache.org/jira/browse/CAMEL-22627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18034388#comment-18034388
]
dvine commented on CAMEL-22627:
-------------------------------
Sorry for the delay:
Finally managed to make a simplified example. The problem seems is related to
kamelets (I couldnt repeat with anything else), wiretap and also toD and
dynamic paths.
If you run the attached, wait for the log "You can now init shutdown", close
then you will see 1 item in flight. After the timer expires it will you will
eventually see it leaps to 4 inflight and eventually
"org.apache.camel.component.kamelet.KameletConsumerNotAvailableException: No
consumers available on endpoint: kamelet://testKamelet?dummy1=<UUID>. "
If UUID remains the same and the route has run once then it occur, hence the
new UUID each time to force the error and also simulates our use case closer.
You need to extend the shutdown grace period as well, we have 15 minutes to
prevent forced shut down.
Route: [^camelerror.txt]
> Camel fails graceful shutdown with wiretap/kamelet
> --------------------------------------------------
>
> Key: CAMEL-22627
> URL: https://issues.apache.org/jira/browse/CAMEL-22627
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Affects Versions: 4.15.0
> Reporter: dvine
> Priority: Minor
> Attachments: camelerror.txt
>
>
> We have long running tasks and set a large grace period during termination to
> clear these. What we see is errors like:
> org.apache.camel.component.kamelet.KameletConsumerNotAvailableException: No
> consumers available on endpoint: kamelet://<removed>?<removed>
> The code around this is called from a wiretap:
> .wireTap( kamelet://<removed>?<removed>") like so. If I replace it with .toD
> then we do not see the issue.
> During normal operation the logs show:
> [d #45 - WireTap] o.a.c.i.e.AbstractCamelContext :
> kamelet://<redacted> converted to endpoint: kamelet://<redacted> by
> component: org.apache.camel.component.kamelet.KameletComponent@320aecd3
> [d #45 - WireTap] o.a.c.s.s.BaseService$Holder : Starting
> service: kamelet://<redacted>
> [d #45 - WireTap] o.a.c.s.s.BaseService$Holder : Started service:
> kamelet://<redacted>
> [d #45 - WireTap] o.a.c.s.c.ServicePool : Creating service
> from endpoint: kamelet://<redacted>
> If camel is shutting down then it forgoese any starting service calls:
> [d #46 - WireTap] o.a.c.i.e.AbstractCamelContext :
> kamelet://<redacted> converted to endpoint: kamelet://<redacted> by
> component: org.apache.camel.component.kamelet.KameletComponent@3d1cb317
> [d #46 - WireTap] o.a.c.s.c.ServicePool : Creating service
> from endpoint: kamelet://<redacted>
> And then leads later to the KameletConsumerNotAvailableException.
> Which makes sense because the code around the starting only starts if camel
> is started and running from what I can see. However this means we cannot
> gracefully complete shutdown.
> I entered this as a bug because it seems to be a problem with
> wiretap/kamelets more specifically but advice regarding a work around for
> this would be appreciated. I havent managed to repeat this with non kamelets.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)