img
. . . . . . . . . . . . . . . . . . . .
Table 20-5. Maven Dependencies for Spring Integration
Group ID
Artifact ID
Version
Description
2.1.0.RELEASE Spring Integration's core library.
org.springframework.integration
spring-
integration-
core
2.1.0.RELEASE Spring Integration's support for
org.springframework.integration
spring-
integration-
file-related I/O integration
patterns.
file
spring-batch- 1.2.1.RELEASE Belongs to the Spring Batch Admin
org.springframework.batch
integration
project, which provides classes for
working with Spring Integration.
For example, the classes for
supporting job launching from
Spring Integration are packaged
into this library.
Add the dependencies in Table 20-5 into the project in STS.
Implementing the File Polling Mechanism
Implementing the file polling mechanism in Spring Integration for launching a Spring Batch job is pretty
easy.
We need to configure the components in Figure 20-6 in Spring's ApplicationContext configuration
(batch-context.xml). Listing 20-10 shows the changes that need to be made to the file.
Listing 20-10. The Revised batch-context.xml File
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:integration="http://www.springframework.org/schema/integration"
xmlns:file="http://www.springframework.org/schema/integration/file"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/file
http://www.springframework.org/schema/integration/file/spring-integration-file.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<!-- Other code omitted -->
<!-- Spring Integration Configuration: Start -->
<integration:channel id="files"/>
Search WWH :
Custom Search
Previous Page
Spring Framework 3 Topic Index
Next Page
Spring Framework 3 Bookmarks
Home