Skip to content

Instantly share code, notes, and snippets.

View mrbq's full-sized avatar
😀

mrbq

😀
View GitHub Profile
@mrbq
mrbq / Dockerfile
Created October 8, 2018 12:46
Add custom driver to Spring Cloud Dataflow
FROM springcloud/spring-cloud-dataflow-server-kubernetes:1.5.2.RELEASE
#Get the oracle driver jar
COPY ojdbc8-12.2.0.1.jar /maven/lib/ojdbc8-12.2.0.1.jar
ENTRYPOINT ["java", "-cp", "/maven/spring-cloud-dataflow-server-kubernetes.jar", "-Dloader.path=/maven/lib", "org.springframework.boot.loader.PropertiesLauncher"]
@mrbq
mrbq / TaskJobCommandLineRunner
Last active October 2, 2018 14:50
CommandLineRunner to failt Spring Cloud Task when Spring Batch Job exit status is FAILED.
import org.springframework.batch.core.*;
import org.springframework.batch.core.explore.JobExplorer;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.batch.core.launch.JobParametersNotFoundException;
import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException;
import org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException;
import org.springframework.batch.core.repository.JobRestartException;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.batch.JobExecutionEvent;
import org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner;
@mrbq
mrbq / CustomTaskDatabaseInitializer
Created October 2, 2018 11:35
Custom Spring Cloud Task Database Initialization when using more than one datasource
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cloud.task.configuration.TaskConfigurer;
import org.springframework.cloud.task.repository.support.TaskRepositoryInitializer;
import org.springframework.context.annotation.Configuration;
import javax.sql.DataSource;
import java.util.Collection;