我想使用camel-redis设置键/值对。我尝试:
spring-redis://localhost:6379?command=SET&CamelRedis.key=testkey&CamelRedis.value=100
但没有喜悦。我得到错误:
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=[{key=testkey, value=100}]
尽管有很多有关如何订阅的示例,但我找不到有关如何设置键/值对的单个示例。我该怎么做?
CamelRedis.Key和 CamelRedis.Value(请注意,它们区分大小写)是消息头而不是URI参数
CamelRedis.Key
CamelRedis.Value
<route> <from uri="direct:intput"/> <setHeader headerName="CamelRedis.Key"><constant>testkey</constant></setHeader> <setHeader headerName="CamelRedis.Value"><constant>100</constant></setHeader> <to uri="spring-redis://localhost:6379?command=SET"/> </route>