I am using Spring XD to create stream twittersearch then wired to my tweet-processor then wired to log.
I used Java config class all fine no issues, then I wanted to add applicationContext.xml in my ModuleConfiguration class using @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);
}
}
And the applicationContext.xml content:
<?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>
And my stream definition: stream create --name JustCreate --definition "twittersearch --query=Java | tweet-processor | log" --deploy
When the stream deployed I got error:
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
I have tried also using spring-module.xml approach (not using Java config at all) and that approach works.
But I am just curious whether Spring XD Java config not supporting @ImportResource annotation.
Thanks.