0
은 RedisMessageTranfomer를 사용하여 헤더가있는 테스트 페이로드를 갖도록 메시지를 푸시했습니다. redis_command = GET to redis outbound gateway 및 아래 나열된 예외로 이동하십시오.스프링 통합 int-redis : 아웃 바운드 게이트웨이 예외
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file.xsd
http://www.springframework.org/schema/integration/http http://www.springframework.org/schema/integration/http/spring-integration-http.xsd
http://www.springframework.org/schema/integration/redis http://www.springframework.org/schema/integration/redis/spring-integration-redis.xsd
http://www.springframework.org/schema/integration/ws http://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd
http://www.springframework.org/schema/integration/xml http://www.springframework.org/schema/integration/xml/spring-integration-xml.xsd"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-file="http://www.springframework.org/schema/integration/file"
xmlns:int-http="http://www.springframework.org/schema/integration/http"
xmlns:int-mail="http://www.springframework.org/schema/integration/mail"
xmlns:int-redis="http://www.springframework.org/schema/integration/redis"
xmlns:int-ws="http://www.springframework.org/schema/integration/ws"
xmlns:si-xml="http://www.springframework.org/schema/integration/xml">
<int-http:inbound-gateway id="omega"
request-channel="channel3" path="/omega" supported-methods="GET,POST"
reply-channel="channel5" />
<int:channel id="channel3">
<int:interceptors>
<int:wire-tap channel="channel3LoggingChannel" />
</int:interceptors>
</int:channel>
<int:logging-channel-adapter id="channel3LoggingChannel"
level="INFO" expression="'*** Channel3 Log ' + headers + ' -> ' + payload">
</int:logging-channel-adapter>
<int:transformer
output-channel="channel4" input-channel="channel3"
ref="redisMessageTransformer"
method="transform">
</int:transformer>
<bean id="redisMessageTransformer"
class="org.springframework.integration.samples.http.RedisMessageTransformer"/>
<int:channel id="channel4">
<int:interceptors>
<int:wire-tap channel="channel4LoggingChannel" />
</int:interceptors>
</int:channel>
<int:logging-channel-adapter id="channel4LoggingChannel"
level="INFO" expression="'*** Channel4 Log ' + headers + ' -> ' + payload">
</int:logging-channel-adapter>
<int-redis:outbound-gateway request-channel="channel4"
reply-channel="channel5" redis-template="redisTemplate"
command-expression="'GET'" />
<bean id="redisTemplate" class="org.springframework.data.redis.core.StringRedisTemplate">
<constructor-arg ref="redisConnectionFactory"/>
</bean>
<bean id="redisConnectionFactory"
class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
p:use-pool="true" p:host-name="127.0.0.1" p:port="6379" />
<bean
id="stringRedisSerializer"
class="org.springframework.data.redis.serializer.StringRedisSerializer"/>
<bean id="payloadArgumentsStrategy"
class="org.springframework.integration.samples.http.PayloadArgumentsStrategy"/>
<int:channel id="channel5">
<int:interceptors>
<int:wire-tap channel="channel5LoggingChannel" />
</int:interceptors>
</int:channel>
<int:logging-channel-adapter id="channel5LoggingChannel"
level="INFO" expression="'*** Channel5 Log ' + headers + ' -> ' + payload">
</int:logging-channel-adapter>
</beans>
package org.springframework.integration.samples.http;
import org.springframework.integration.redis.support.RedisHeaders;
import org.springframework.messaging.Message;
import org.springframework.messaging.support.MessageBuilder;
public class RedisMessageTransformer {
public Object transform(Object object)
{
Object m = object;
System.out.println("*** object.getClass().getName = " + object.getClass().getName());
m = MessageBuilder.withPayload("test").setHeader(RedisHeaders.COMMAND, "GET").build();
System.out.println("*** m = " + m);
return m;
}
}
예외 필요가 무엇
<pre> Server Error</pre></p><h3>Caused by:</h3><pre>java.lang.NoSuchMethodError: org.springframework.data.redis.connection.RedisConnection.execute(Ljava/lang/String;[[B)Ljava/lang/Object;
at org.springframework.integration.redis.outbound.RedisOutboundGateway$1.doInRedis(RedisOutboundGateway.java:125)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:162)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:133)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:121)
at org.springframework.integration.redis.outbound.RedisOutboundGateway.handleRequestMessage(RedisOutboundGateway.java:121)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:170)
은> 레디 스에서 값을 읽기 (GET)하는 레디 스-outboundgateway을 얻기 위해 변경해야?
이 감사에 대한 어떤에 그와 같은 이적 종속되어 사용하는 것을 시도하십시오 -이 버전 문제 –
좋았어요! 그래서, 그것은 답을 받아들이 기 좋은 형태를 상처를 입혔습니다. 감사 –