Skip to content

Instantly share code, notes, and snippets.

Jonás jonasurbano

Block or report user

Report or block jonasurbano

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View extras.txt
Spring Batch give us those ItemReader implementations out of the box:
AbstractItemCountingItem
StreamItemReader
AmqpItemReader
FlatFileItemReader
HibernateCursorItemReader
HibernatePagingItemReader
IbatisPagingItemReader
ItemReaderAdapter
JdbcCursorItemReader
View integrateSpringCloudTask.sh
# 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
View getSummary.txt
id=1,
version=3,
name=step1,
status=COMPLETED,
exitStatus=COMPLETED,
readCount=3,
filterCount=0,
writeCount=2
readSkipCount=1,
writeSkipCount=1,
View stepWithFaultTolerant.java
@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)
View jobDefinition.java
@Bean
public Job job(Step step1) throws Exception {
return jobBuilderFactory.get("job1")
.incrementer(new RunIdIncrementer())
.start(step1)
.build();
}
@Bean
public Step step1() {
View extras.txt
Spring Batch give us those ItemReader implementations out of the box:
AbstractItemCountingItem
StreamItemReader
AmqpItemReader
FlatFileItemReader
HibernateCursorItemReader
HibernatePagingItemReader
IbatisPagingItemReader
ItemReaderAdapter
JdbcCursorItemReader
View Servicio.java
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";
View JsonMap.java
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;
@jonasurbano
jonasurbano / LosEnumMolan.java
Last active Dec 26, 2015
Ejemplo de uso de enum
View LosEnumMolan.java
package pruebaEnum;
import java.util.Locale;
public class LosEnumMolan {
public enum Divisa {
EUR, USD, BTC;
public String toLowerCase() {
You can’t perform that action at this time.