You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2019/03/12 11:22:00 UTC

[jira] [Commented] (CAMEL-13312) ModelCamelContext loadRoutesDefinition/loadRestsDefinition are misleading

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

Claus Ibsen commented on CAMEL-13312:
-------------------------------------

Yeah the load methods has been removed and you can use the ModelHelper if you just want to load.
And then added new add methods like the others that take an input stream as argument.
And also made sure when adding rest they are also added as routes, so you dont have to remember to do that manually afterwards.

> ModelCamelContext loadRoutesDefinition/loadRestsDefinition are misleading
> -------------------------------------------------------------------------
>
>                 Key: CAMEL-13312
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13312
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Luca Burgazzoli
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 3.0.0, 3.0.0-M2
>
>
> We do have method like loadRoutesDefinition and loadRestsDefinition in the ModelCamelContext interface but they are a little bit misleading as they do not load a definition in the camel context but they are an helper that invoke
> {code}
> ModelHelper.loadRoutesDefinition(this, is)
> {code}
> The only advantage is that you do not need to pass the camel context but other that that they appear as pure utility.
> Toproperly load a route one need to do something something like
> {code}
> context.addRouteDefinitions(context.loadRoutesDefinition(is).getRoutes())
> {code}
> which is a little ugly



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