padcom/grails-routing — Issue #8: Filters and runtime routes
Author: Gmonkey
Created: 2012-01-20 02:27:55+00:00
State: open

I have an issue with runtime routes and using filters.
I am using the example from
http://padcom13.blogspot.com/2011/01/grails-camel-and-adding-routes-in.html
Here is the only change
from("seda:input").filter {it.in.body.contains("from")}.to("stream:out")

I get the following error

| Error 2012-01-19 21:22:22,396 ["http-bio-8080"-exec-10] ERROR errors.GrailsExc
eptionResolver - ClassCastException occurred when processing request: [GET] /in
tuitiveoms/startFixEngine/index
org.apache.camel.model.FilterDefinition cannot be cast to org.apache.camel.model
.RouteDefinition. Stacktrace follows:
Message: org.apache.camel.model.FilterDefinition cannot be cast to org.apache.ca
mel.model.RouteDefinition
Line | Method

->> 643 | addRouteDefinitions in org.apache.camel.impl.DefaultCamelContext
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 20 | index in com.transatron.fix.StartFixEngineController$$EN
MVWQ8M
| 886 | runTask . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . . . . . . . in java.lang.Thread

Not sure what I am doing wrong.

Thanks