Skip to content

Routes not registering in camel context, application.routeClasses = [] #42

@raffian

Description

@raffian

Tried to get this working in 2.3.8.

create-route doesn't work, so I added MyMessageRoute to grails-app/routes, but after starting app and sending test message, route is never triggered. Checked camelContext.getRoutes(), no routes registered! So I registered manually in BootStrap...

def init = { servletContext ->                
        def _camelCtx =
            grailsApplication.mainContext.getBean('camelContext')
        _camelCtx.addRoutes(new MyMessageRoute())

Now it works!

Looking at plugin file, appears route classes should auto register, but application.routeClasses is empty list just before routeClasses.each { routeClass ->, I suspect this is the problem, but how is routeClasses populated?

My BuildConfig

    dependencies {
        //for jms issue
        compile('org.springframework:spring-jms:3.2.6.RELEASE'){
            export = false
        }

        //from routing-jms, could not get that plugin to work, had to manually add dependencies
        runtime('commons-logging:commons-logging:1.1.1')
        runtime('org.apache.activemq:activemq-core:5.7.0')
        runtime('org.apache.activemq:activemq-camel:5.9.0')
        runtime('org.apache.activemq:activemq-pool:5.9.0')
        runtime('org.apache.camel:camel-jms:2.13.0') {
            excludes 'spring-aop', 'spring-beans', 'spring-core', 'spring-expression', 'spring-asm', 'spring-tx', 'spring-context'
        }
    }

    plugins {
        build ":tomcat:7.0.52.1"
        compile ":scaffolding:2.0.2"
        compile ":routing:1.3.2"
    } 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions