This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spring Batch give us those ItemReader implementations out of the box: | |
AbstractItemCountingItem | |
StreamItemReader | |
AmqpItemReader | |
FlatFileItemReader | |
HibernateCursorItemReader | |
HibernatePagingItemReader | |
IbatisPagingItemReader | |
ItemReaderAdapter | |
JdbcCursorItemReader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download and run Spring Cloud Data Flow locally: | |
wget http://repo.spring.io/release/org/springframework/cloud/spring-cloud-dataflow-server-local/1.2.3.RELEASE/spring-cloud-dataflow-server-local-1.2.3.RELEASE.jar | |
java -jar spring-cloud-dataflow-server-local-1.2.3.RELEASE.jar | |
# Download and run Spring Cloud Data Flow Shell locally: | |
wget http://repo.spring.io/release/org/springframework/cloud/spring-cloud-dataflow-shell/1.2.3.RELEASE/spring-cloud-dataflow-shell-1.2.3.RELEASE.jar | |
java -jar spring-cloud-dataflow-shell-1.2.3.RELEASE.jar | |
# Register the application: | |
app register — name batch-demo — type task — uri file:///Users/jurbano/Desktop/batch-demo-0.0.1-SNAPSHOT.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id=1, | |
version=3, | |
name=step1, | |
status=COMPLETED, | |
exitStatus=COMPLETED, | |
readCount=3, | |
filterCount=0, | |
writeCount=2 | |
readSkipCount=1, | |
writeSkipCount=1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Bean | |
public Step step1() { | |
return stepBuilderFactory.get("step1") | |
.<Person,Person>chunk(2) | |
.reader(csvReader()) | |
.writer(writer()) | |
.faultTolerant() | |
.skipLimit(2) | |
.skip(FlatFileParseException.class) | |
.skip(FlatFileFormatException.class) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Bean | |
public Job job(Step step1) throws Exception { | |
return jobBuilderFactory.get("job1") | |
.incrementer(new RunIdIncrementer()) | |
.start(step1) | |
.build(); | |
} | |
@Bean | |
public Step step1() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spring Batch give us those ItemReader implementations out of the box: | |
AbstractItemCountingItem | |
StreamItemReader | |
AmqpItemReader | |
FlatFileItemReader | |
HibernateCursorItemReader | |
HibernatePagingItemReader | |
IbatisPagingItemReader | |
ItemReaderAdapter | |
JdbcCursorItemReader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.pfc.domain; | |
import javax.persistence.Column; | |
import org.codehaus.jackson.annotate.JsonIgnore; | |
import org.pfc.utils.JsonMap; | |
public class Servicio { | |
private static final String CLAVE_VISITAS = "visitas"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.pfc.utils; | |
import java.io.ByteArrayInputStream; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.apache.log4j.Logger; | |
import org.codehaus.jackson.JsonFactory; | |
import org.codehaus.jackson.map.ObjectMapper; | |
import org.codehaus.jackson.type.TypeReference; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pruebaEnum; | |
import java.util.Locale; | |
public class LosEnumMolan { | |
public enum Divisa { | |
EUR, USD, BTC; | |
public String toLowerCase() { |