camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kostyantyn Oliynyk (JIRA)" <j...@apache.org>
Subject [jira] Updated: (CAMEL-2398) DefaultCamelContext starts route services out of order
Date Mon, 25 Jan 2010 03:12:46 GMT

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

Kostyantyn Oliynyk updated CAMEL-2398:
--------------------------------------

    Description: 
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 Ester demo example for Ester, 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 returns 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 .  

  was:
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 exampe for Ester 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 returns values in different order.  

Please, be advise that 3-rd routes 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 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 and has no impact on reported Camel issue with
avgCnt and feedCnt.  


> 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
>
> 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 Ester demo example for Ester, 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 returns 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.


Mime
View raw message