骆驼路由到redis集成异常

时间:2018-03-23 10:26:06

标签: java spring spring-boot redis apache-camel

我正在尝试将Redis与骆驼路线集成,因为我正在尝试使用骆驼路线在Redis中设置一个键,我是radis和camel的新来者,尽管根据我的不足,有一个问题。端点Failed to resolve endpoint: spring-redis://127.0.0.1:6379?CamelRedis.Key=testkey&CamelRedis.Value=100&command=SET due to: Failed to resolve endpoint: spring-redis://127.0.0.1:6379?CamelRedis.Key=testkey&CamelRedis.Value=100&command=SET due to: There are 2 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{CamelRedis.Key=testkey, CamelRedis.Value=100}]请看看......

是的,我会在from&之间放置一个处理器。 to为了将输入从SOURCE映射到DESTINATION,我将能够将虚拟值插入redis,现在它是一个硬编码值。

骆驼路线

private static final String SOURCE = "file:C:/Users/sahmad4/workspace/EmailResponseAutomation/response/";
private static final String DESTINATION = "spring-redis://127.0.0.1:6379?command=SET&CamelRedis.Key=testkey&CamelRedis.Value=100";

    @Override
    public void configure() throws Exception {
        from(SOURCE)
        .to(DESTINATION);
    }

控制台输出

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-03-23 15:45:08.673 ERROR 17164 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.apache.camel.spring.boot.CamelSpringBootInitializationException: java.lang.RuntimeException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[spring-redis://127.0.0.1:6379?command=SET&CamelRedis.Key=testkey&CamelRedis.Value=100] <<< in route: Route(route1)[[From[file:C:/Users/sahmad4/workspace/EmailRes... because of Failed to resolve endpoint: spring-redis://127.0.0.1:6379?CamelRedis.Key=testkey&CamelRedis.Value=100&command=SET due to: Failed to resolve endpoint: spring-redis://127.0.0.1:6379?CamelRedis.Key=testkey&CamelRedis.Value=100&command=SET due to: There are 2 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{CamelRedis.Key=testkey, CamelRedis.Value=100}]
    at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:126) ~[camel-spring-boot-2.17.0.jar:2.17.0]
    at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:41) ~[camel-spring-boot-2.17.0.jar:2.17.0]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:399) ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:353) ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:887) ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:161) ~[spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:388) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1234) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
    at com.era.conf.ApplicationConfiguration.main(ApplicationConfiguration.java:12) [classes/:na]
Caused by: java.lang.RuntimeException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[spring-redis://127.0.0.1:6379?command=SET&CamelRedis.Key=testkey&CamelRedis.Value=100] <<< in route: Route(route1)[[From[file:C:/Users/sahmad4/workspace/EmailRes... because of Failed to resolve endpoint: spring-redis://127.0.0.1:6379?CamelRedis.Key=testkey&CamelRedis.Value=100&command=SET due to: Failed to resolve endpoint: spring-redis://127.0.0.1:6379?CamelRedis.Key=testkey&CamelRedis.Value=100&command=SET due to: There are 2 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{CamelRedis.Key=testkey, CamelRedis.Value=100}]
    at org.apache.camel.spring.boot.CamelSpringBootApplicationController.run(CamelSpringBootApplicationController.java:73) ~[camel-spring-boot-2.17.0.jar:2.17.0]
    at org.apache.camel.spring.boot.CamelMainRunController$DaemonTask.run(CamelMainRunController.java:43) ~[camel-spring-boot-2.17.0.jar:2.17.0]
    at java.lang.Thread.run(Unknown Source) ~[na:1.8.0_102]
    at org.apache.camel.spring.boot.CamelMainRunController.start(CamelMainRunController.java:36) ~[camel-spring-boot-2.17.0.jar:2.17.0]
    at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:113) ~[camel-spring-boot-2.17.0.jar:2.17.0]
    ... 16 common frames omitted
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[spring-redis://127.0.0.1:6379?command=SET&CamelRedis.Key=testkey&CamelRedis.Value=100] <<< in route: Route(route1)[[From[file:C:/Users/sahmad4/workspace/EmailRes... because of Failed to resolve endpoint: spring-redis://127.0.0.1:6379?CamelRedis.Key=testkey&CamelRedis.Value=100&command=SET due to: Failed to resolve endpoint: spring-redis://127.0.0.1:6379?CamelRedis.Key=testkey&CamelRedis.Value=100&command=SET due to: There are 2 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{CamelRedis.Key=testkey, CamelRedis.Value=100}]
    at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1072) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:196) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:974) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:3295) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3018) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:175) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2848) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2844) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2867) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2844) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2813) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.main.Main.doStart(Main.java:127) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.main.MainSupport.run(MainSupport.java:138) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.spring.boot.CamelSpringBootApplicationController.run(CamelSpringBootApplicationController.java:68) ~[camel-spring-boot-2.17.0.jar:2.17.0]
    ... 20 common frames omitted
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: spring-redis://127.0.0.1:6379?CamelRedis.Key=testkey&CamelRedis.Value=100&command=SET due to: Failed to resolve endpoint: spring-redis://127.0.0.1:6379?CamelRedis.Key=testkey&CamelRedis.Value=100&command=SET due to: There are 2 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{CamelRedis.Key=testkey, CamelRedis.Value=100}]
    at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:588) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:79) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:211) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:62) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:56) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.model.ProcessorDefinition.makeProcessorImpl(ProcessorDefinition.java:534) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:495) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:219) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1069) ~[camel-core-2.17.0.jar:2.17.0]
    ... 35 common frames omitted
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: spring-redis://127.0.0.1:6379?CamelRedis.Key=testkey&CamelRedis.Value=100&command=SET due to: There are 2 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{CamelRedis.Key=testkey, CamelRedis.Value=100}]
    at org.apache.camel.impl.DefaultComponent.validateParameters(DefaultComponent.java:183) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:128) ~[camel-core-2.17.0.jar:2.17.0]
    at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:568) ~[camel-core-2.17.0.jar:2.17.0]
    ... 45 common frames omitted

0 个答案:

没有答案