【发布时间】:2015-10-21 03:57:25
【问题描述】:
我正在使用 Spring XD 创建流 twittersearch,然后连接到我的推文处理器,然后连接到日志。
我使用 Java 配置类都很好,没有问题,然后我想使用 @ImportResource 在我的 ModuleConfiguration 类中添加 applicationContext.xml
@Configuration
@ImportResource("config/applicationContext.xml")
@EnableIntegration
public class ModuleConfiguration {
@Bean
MessageChannel input() {
return new DirectChannel();
}
@Bean
MessageChannel output() {
return new DirectChannel();
}
@Autowired
TweetProcessor tweetProcessor;
@Bean
freemarker.template.Configuration configuration() {
return new freemarker.template.Configuration(freemarker.template.Configuration.VERSION_2_3_23);
}
}
以及applicationContext.xml内容:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>file:/apps/conf/application.properties</value>
</list>
</property>
</bean>
</beans>
还有我的流定义:流创建 --name JustCreate --definition "twittersearch --query=Java | tweet-processor | log" --deploy
部署流时出现错误:
2015-10-21T11:26:26+0800 1.2.1.RELEASE WARN twitterSource-1-1 twitter.TwitterSearchChannelAdapter - Exception while reading stream.
org.springframework.messaging.MessageDeliveryException: Dispatcher has no subscribers for channel 'singlenode:default,admin,singlenode,hsqldbServer:9393.JustCreate.0'.; nested exception is org.springframework.integration.MessageDispatchingException: Dispatcher has no subscribers
我也尝试过使用 spring-module.xml 方法(根本不使用 Java 配置)并且该方法有效。
但我只是好奇 Spring XD Java 配置是否不支持 @ImportResource 注释。
谢谢。
【问题讨论】:
标签: spring-xd