I am trying to create a simple spike that is an extension to one of the spring integration samples for transferring files.
In this original example the config looks like this
I have changed this toHTML Code:<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/> <file:inbound-channel-adapter id="filesIn" directory="file:${java.io.tmpdir}/spring-integration-samples/input" > <!--filename-pattern="[a-z]+.txt"--> <integration:poller id="poller" fixed-delay="5000"/> </file:inbound-channel-adapter> <file:file-to-string-transformer input-channel="filesIn" output-channel="strings"/> <integration:channel id="strings"/> <integration:service-activator input-channel="strings" output-channel="filesOut" ref="handler"/> <file:outbound-channel-adapter id="filesOut" directory="file:${java.io.tmpdir}/spring-integration-samples/output"/> <bean id="handler" class="org.springframework.integration.samples.filecopy.Handler"/>
The handler used to just log and return the same string.HTML Code:<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/> <bean class="org.springframework.integration.aop.PublisherAnnotationBeanPostProcessor"/> <integration:annotation-config/> <file:inbound-channel-adapter id="filesIn" directory="file:${java.io.tmpdir}/spring-integration-samples/input" > <!--filename-pattern="[a-z]+.txt"--> <integration:poller id="poller" fixed-delay="5000"/> </file:inbound-channel-adapter> <file:file-to-string-transformer input-channel="filesIn" output-channel="strings"/> <integration:channel id="strings"/> <!-- the handler in this case is responsible for sending messages to a real Q --> <integration:service-activator input-channel="strings" ref="handler"/> <!--output-channel="filesOut"--> <bean id="handler" class="com.musa.spike.Handler"/> <!-- this should be called when the FileMessageHandler gets Fired --> <file:outbound-channel-adapter id="filesOut" directory="file:${java.io.tmpdir}/spring-integration-samples/output"/>
Now it does this
In a separate process I have this target setup as a message listenerCode:public void handleString(String input) {System.out.println("Sending file contents to teh default Rabbit MQ Queue"); ApplicationContext context = new AnnotationConfigApplicationContext(HelloWorldConfiguration.class); AmqpTemplate amqpTemplate = context.getBean(AmqpTemplate.class); amqpTemplate.convertAndSend(input);}
This gets called as expected but the output-channel-adapter is not being invoked.Code:public class FileMessageHandler { @Publisher(channel="filesOut") public String handleMessage(String text) { System.out.println("Received: message from Rabbit MQ"); return text; } }
I have addedHTML Code:<file:outbound-channel-adapter id="filesOut" directory="file:${java.io.tmpdir}/spring-integration-samples/output"/>
To the integration xml file. Can anyone tell me what I may have missed?HTML Code:<bean class="org.springframework.integration.aop.PublisherAnnotationBeanPostProcessor"/> <integration:annotation-config/>


Reply With Quote
