langmi / spring-batch-examples Goto Github PK
View Code? Open in Web Editor NEWCollection of Spring Batch Examples
Home Page: http://www.langmi.de
License: Other
Collection of Spring Batch Examples
Home Page: http://www.langmi.de
License: Other
new example for automatic thread configuration
usecase:
TaskExecutor shall use as much threads as the systems makes possible.
example code:
public class AsyncTaskExecutorFactory {
private static final Logger LOG = LoggerFactory.getLogger(AsyncTaskExecutorFactory.class);
public static SimpleAsyncTaskExecutor createInstance() {
SimpleAsyncTaskExecutor instance = new SimpleAsyncTaskExecutor();
// set concurrencyLimit according to available processors
// real simple 1:1 relation
Runtime runtime = Runtime.getRuntime();
int nrCpu = runtime.availableProcessors();
LOG.debug("TaskExecutor ConcurrencyLimit:" + String.valueOf(nrCpu));
instance.setConcurrencyLimit(nrCpu);
return instance;
}
}
<!-- Factory configures SimpleAsyncTaskExecutor, checks available
processors for the concurrency limit. -->
<bean id="taskExecutor"
class="de.langmi.logstatisticbatch.support.AsyncTaskExecutorFactory"
factory-method="createInstance"/>
by crawling knee deep in the spring batch api i found a hidden gem the StepSynchronizationManager
it can be used to access the current step context in a stateless bean, time to experiment with it
just create an individual project from the MultiResourcePartitioner used in the rename-files examples
usecase:
for batch prototyping sometimes one needs a real simple itemReader
example code: see skip example
this forum entry for jpa exception on flush on commit won't be the last and is definitely not the first question to this problem
how to cope with jpa exceptions on commit
some unordered thoughts
right now the more generic example is implemented with a listener which needs to use file.deleteOnExit() to delete the old files after copying
there should be another example with an extra step - it should be possible to use FileUtils.moveTo without problems
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.