【发布时间】:2018-11-21 07:30:03
【问题描述】:
我想配置 InboundChannelAdapter 以便它应该从 redis 队列中弹出消息并将其传递给基于 Java 的注释中的 ServiceActivator(仅限,更喜欢避免使用 XML)。我从 Spring 文档中找到了代码:
@Bean("someAdapter.source")
@EndpointId("someAdapter")
@InboundChannelAdapter(channel = "channel3", poller = @Poller(fixedDelay = "5000"))
public MessageSource<?> source() {
return () -> {
...
};
}
但我在这里不明白的是,如何通过使用redisConnectionFactory从redis队列中弹出数据来返回MessageSource?
换句话说,如何在基于 java 的注解中做到这一点?
<int-redis:queue-inbound-channel-adapter id="postPublicationInboundAdapter"
connection-factory="redisConnectionFactory"
channel="postPublicationChannel"
error-channel="postPublicationLoggingChannel"
receive-timeout="5000"
queue="archive.post.publication.queue"
serializer="postPublicationJsonRedisSerializer"/>
【问题讨论】:
标签: java redis spring-integration