You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Grzegorz Grzybek (JIRA)" <ji...@apache.org> on 2019/01/07 10:29:00 UTC

[jira] [Commented] (CAMEL-12980) Bundle in 'Active' State but Camel Context not initialized

    [ https://issues.apache.org/jira/browse/CAMEL-12980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16735642#comment-16735642 ] 

Grzegorz Grzybek commented on CAMEL-12980:
------------------------------------------

I read again through https://github.com/apache/camel/pull/1297 and CAMEL-10513 and tbh, I prefer *not to* revert CAMEL-10513 (as this CAMEL-12980 is effectively a revert of CAMEL-10513).

What convinced me is:
bq. The example would fail if the autoStartup="false" attribute were present in the XML as well

Indeed, starting (optionally) a Camel context after {{BlueprintEvent.CREATED}} separates Blueprint and Camel lifecycles. While there's one benefit of not doing it:
* seeing {{Failed}} in a list of bundles

I think there are more drawbacks:
* handling contexts with _auto startup_ set to {{false}}
* suggesting that Camel context *is* blueprint container, but a container for bundle may declare more contexts and/or also one context may be implemented in different bundles (importing routes defined in separate bundles)
* reviewing all the adjustments we had to make after accepting CAMEL-10513

In my opinion it's better to use dedicated Camel commands to check status of Camel contexts/routes.

> Bundle in 'Active' State but Camel Context not initialized
> ----------------------------------------------------------
>
>                 Key: CAMEL-12980
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12980
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-blueprint
>    Affects Versions: 2.20.1, 2.21.1
>            Reporter: Xilai Dai
>            Assignee: Grzegorz Grzybek
>            Priority: Critical
>             Fix For: 2.22.3, 3.0.0, 2.24.0, 2.23.1
>
>         Attachments: blueprint.xml
>
>
> The camel context can't get initialized when validation of the RouteDefinition failed (e.g. typo in Uri or add an unsupported option in Uri), but when deploy the blueprint, the CamelContext startup and then shutdown, but the bundle status is still 'Active', only a FailedToCreateRouteException ERROR is logged.
> 318 │ Active  │  80 │ 0.0.0                 │ blueprint.xml
> Attached the simple blueprint.xml for reproduce it.
> The expected behaviour is the bundle is in the 'Failure' status in this case.
> The fix proposal from my side is, move the call of "this.maybeStart()" from blueprintEvent() method to the constructor of the BlueprintCamelContext class. then this kind of Route definition error can be processed during the Blueprint "CREATING" phase. Currently, the start() is invoked after Blueprint in "CREATED" phase. (I tested this fix locally and have the expected 'Failure' bundle status) 
> (This issue is found in Camel 2.20.x, 2.21.x, but it may affects also on master branch)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)