我正在使用Spring XD创建流twittersearch,然后连线到我的tweet处理器,然后连接到日志。Spring XD Java配置不加载xml资源
我使用的Java配置类的所有罚款没有任何问题的话,我想用@ImportResource
@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的内容添加的applicationContext.xml我ModuleConfiguration类:
<?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>
我的流定义:stream create --name JustCreate --definition“twittersearch --query = Java | tweet-processor | log”--deploy
当stre我部署了我的错误:
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
我曾尝试使用也弹簧module.xml方法(不使用Java的配置在所有)和方法工作。
但我只是好奇Spring XD Java配置是否不支持@ImportResource注释。
谢谢。
由于您的XML仅添加了PPC;你可以使用'@ PropertySource'来代替 - 查看[这个问题]的答案(http://stackoverflow.com/questions/33149198/spring-integration-spel-issues-with-annotation)。 –
谢谢你们! – nanokernel