Can I use Spring Integration as a daemon to query a directory?

I am new to Spring integration, and I am considering using it to query the directory for new files to process these files.

My question is: Is there Spring Integration of some kind of daemon that can be launched, and what can be used to poll the directory ?

Is it possible that someone can direct me to the appropriate section of the official documentation on how to run Spring Integration?

+4
source share
2 answers

All you need is to have a main method (or a WAR file if you want to deploy it to Tomcat or another servlet container) that creates the ApplicationContext Spring (for example, the new ClassPas thanksmlApplicationContext ("file-poller.xml"))

It can work with a cron trigger, with a fixed speed or with a delay with a fixed delay.

JMX operations can be opened in the Spring integration file adapter (or any adapter) by simply adding one configuration item (for example, <mbean-export>).

Bottom line: you don't need an ESB if you just want it to run continuously. You can have one small configuration file and one line of code in the main method.

Visit the samples for more information: https://github.com/springsource/spring-integration-samples (see under the main / file)

Hope this helps, Mark

+3
source

Spring Integration is part of the framework; it is not a program or daemon.

What you cannot do is set up Spring Integration to query the directory, lunch the JVM with Spring on board, and the poller will do what you want.

You can start with this blog post. Additional samples

Relevant Documentation Section

+2
source

All Articles