You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2010/01/27 21:21:32 UTC

[jira] Resolved: (CAMEL-2398) DefaultCamelContext starts route services out of order

     [ https://issues.apache.org/activemq/browse/CAMEL-2398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-2398.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.2.0

trunk: 903817.

> DefaultCamelContext starts route services out of order 
> -------------------------------------------------------
>
>                 Key: CAMEL-2398
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2398
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.1.0
>         Environment: Linux ubuntu 2.6.24-26-generic,  java  1.5.0_16, Esper 3.3.0
>            Reporter: Kostyantyn Oliynyk
>            Assignee: Claus Ibsen
>             Fix For: 2.2.0
>
>
> org.apache.camel.impl.DefaultCamelContext uses HashMap to hold route services
> In start() method it uses routeServices.values() to list route services.
> It does not work for Esper.
> Camel-extra Esper demo example for Esper, http://code.google.com/p/camel-extra/wiki/EsperDemo, creates 3 routes:
> 1: Route[[From[activemq:EventStreamQueue]] -> [To[esper://feed]]]
> 2: Route[[From[esper://feed?eql=insert into TicksPerSecond select feed, count(*) as cnt from com.iona.ps.demos.MarketDataEvent.win:time_batch(1 sec) group by feed]] -> [To[esper://feed]]]
> 3: Route[[From[esper://feed?eql=select feed, avg(cnt) from TicksPerSecond.win:time(10 sec) group by feed + having cnt < avg(cnt) * 0.75]] -> [To[esper://feed], process[com.iona.ps.demos.MyRouteBuilder$1@1274069]]]
>   
> 3-rd route depends on 2-nd route, it uses TicksPerSecond event type that gets created in route 2.
> DefaultCamelContext starts 3-rd route before 2-nd route, as a result Esper fails to resolve event type:
> com.espertech.esper.epl.expression.ExprValidationException: Failed to resolve event type: Event type or class named 'TicksPerSecond' was not found
> 	at com.espertech.esper.epl.spec.FilterStreamSpecRaw.resolveType(FilterStreamSpecRaw.java:189)
> 	at com.espertech.esper.epl.spec.FilterStreamSpecRaw.compile(FilterStreamSpecRaw.java:99)
> 	at com.espertech.esper.core.StatementLifecycleSvcImpl.compile(StatementLifecycleSvcImpl.java:956)
> 	at com.espertech.esper.core.StatementLifecycleSvcImpl.createStopped(StatementLifecycleSvcImpl.java:195)
>         ... 
> As a workaround, it is possible to change startup order by assigning custom ids to routes, so routeServices HashMap would return values in different order.  
> Please, be advise that 3-rd route's From URI: "esper://feed?eql=select feed, avg(cnt) from TicksPerSecond.win:time(10 sec) group by feed + having cnt < avg(cnt) * 0.75" is modified,
> original From URI from svn:
> "esper://feed?eql=select feed, avg(cnt) as avgCnt, cnt as feedCnt from TicksPerSecond.win:time(10 sec) group by feed + having cnt < avg(avgCnt) * 0.75" 
> It was done to resolve Esper compiling issue with avgCnt and feedCnt and has no impact on this reported Camel issue .  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.