gpt4 book ai didi

redis - 使用 camel-redis 设置 redis 键/值

转载 作者:可可西里 更新时间:2023-11-01 11:24:45 26 4
gpt4 key购买 nike

我想使用 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.KeyCamelRedis.Value(注意它们区分大小写)是消息头而不是 URI 参数

<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>

关于redis - 使用 camel-redis 设置 redis 键/值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49447491/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com