복붙노트

[REDIS] 세트 낙타 레디 스에 키 / 값 레디 스

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

키 / 값 쌍을 설정하는 방법에 대한 하나의 예를 찾을 수없는 등 내가 구독하는 방법에 대한 많은 예들이 있지만. 나는 어떻게 할 것인가?

해결법

  1. ==============================

    1.CamelRedis.Key 및 CamelRedis.Value 메시지 헤더되지 URI 매개 변수입니다 (그들은 대소 문자를 구분 조심)

    CamelRedis.Key 및 CamelRedis.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>
    
  2. from https://stackoverflow.com/questions/23119359/set-redis-key-value-with-camel-redis by cc-by-sa and MIT license