0

I developed a project that uses camel smpp routes in karaf.
In the beginning I used spring to write my camel routes. That worked fine.
Later I tried to use java DSL to write the camel smpp routes but everything I have done, results to this.

org.apache.camel.FailedToCreateRouteException: Failed to create route route1: Route(route1)[[From[smpp://username@localhost:2775?pa... because of Failed to resolve endpoint: smpp://username@localhost:2775?password=apassword due to: No component found with scheme: smpp

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint:   smpp://username@localhost:2775?password=apassword due to: No component found with scheme: smpp

I have even tried blueprint to call the bean that creates the java DSL camel routes but keep getting the above.

from karaf console:

karaf@root> list | grep smpp
[ 171] [Active     ] [            ] [       ] [   50] Apache ServiceMix :: Bundles :: jsmpp (2.1.0.4)
[ 172] [Active     ] [            ] [       ] [   50] camel-smpp (2.11.0)
karaf@root> features:list | grep smpp
[installed  ] [2.11.0         ] camel-smpp                              camel-2.11.0

What I am trying to call is this snippet from a bean either in spring or blueprint:

context.addRoutes(new RouteBuilder() {
    public void configure() {
        fromF("smpp://%s@%s:%s?password=%s", username, destination, port, password)
        .bean(new SmsReceiver(), "printPdus");
    }
});             
context.start();

What should I do to make the java DSL smpp route work? Why does smpp route in spring works but java DSL smpp doesn't? What should I install or search for?

4

2 回答 2

0

请参阅此页面http://camel.apache.org/spring使用 Java 代码部分如何从 spring xml 文件中引用一个 <bean>,它是 Java RouteBuilder 类。这就是让它在 OSGi 中工作的方式。

于 2013-09-04T11:42:48.260 回答
0

似乎您直接使用骆驼上下文,并将路由添加到上下文实例(如何创建?)。如果您创建 DefaultCamelContext 实例,那么您需要配置特定的组件解析器(请参阅 org.apache.camel.core.osgi.OsgiComponentResolver)。

于 2013-09-04T15:33:13.077 回答