我正在使用grails 3.0.4,而install-plugin不再起作用。我已经在gradle依赖项中添加了路由插件,但是我可以像在线示例中一样使用grails create-route命令。我在grails-app / routes中创建了自己的路由类,但是当我运行grails时,似乎根本不使用路由。我是否需要做一些额外的配置,例如在某个地方创建bean?
我的课如下:
import org.apache.camel.builder.RouteBuilder
class TrackingMessageRoute extends RouteBuilder {
def grailsApplication
@Override
void configure() {
def config = grailsApplication?.config
from('seda:input.queue').to('stream:out')
from('mina2:tcp://localhost:553').to('stream:out')
}
}
最佳答案
Grails 3的路由插件尚未更新。
有关几个重要插件的Grails 3准备状态,请参见https://github.com/grails/grails-core/wiki/Grails-3-Priority-Upgrade-Plugins。
由于Grails 3与Spring引导紧密相关,因此直接使用Camel库应该相对容易(不需要插件)。有关可能有用的信息,请参见http://camel.apache.org/spring-boot.html。
关于grails - 为Grails 3.0.4配置 Camel 路由,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31947243/