Spring Batch from Gosu - spring

I would like to use Spring Batch as a library from Gosu. Do you have a comprehensive example on how to wire a Spring batch job in java code?

There is new support for #Configuration in Spring Batch 2.2 snapshots, but I have no idea if that helps you in Gosu. Example here. If you need to create everything imperatively look at SimpleJob and SimpleStepFactoryBean.

Related

Spring Batch Java annotated - restart example

Using the Spring Boot, Batch example: https://spring.io/guides/gs/batch-processing/
Project is now running, but the site doesn't go into how to write Unit tests around this structure. Github examples for Spring Batch show xml examples, which do not seem to correlate to this boot style.
Has anyone ran into any good Spring Boot, Batch examples that show restarting, unit testing, etc
The reference documentation was recently updated to provide java based configuration examples for every example in the doc. You can check out our testing page and see the java examples here: https://docs.spring.io/spring-batch/4.0.x/reference/html/testing.html#testing

Minimal and latest way of triggering batch job in the world of Spring Boot

I have setup a batch job with Spring Boot 1.5.8 and relevant Spring Batch and Integration starters. I want to kick off the job using incoming file using file poller.
I have used Spring Integration in old days to trigger batch job with file poller. Is this still stands same ? Does Spring Batch itself has this very basic functionality or do I have to have Spring Integration involved as well ?
Even if Spring Integration is needed, can anybody point to Annotation based sample application doing the same ?
Good questions. Let's answer each of them:
Is this still stands same ? Yes
Does Spring Batch itself has this very basic functionality or do I have to have Spring Integration involved as well ? No, you have to use Spring Integration
Even if Spring Integration is needed, can anybody point to Annotation based sample application doing the same ?
We are in the midst of updating all the Batch docs to include annotation as well as XML based configurations. Here is a doc that is in PR but will be merged in the next release that has the examples you are looking for:
https://github.com/cppwfs/spring-batch/blob/1f7cada52aba95bcb23d06bc034b21fe1de0a7a5/spring-batch-docs/asciidoc/spring-batch-integration.adoc#launching-batch-jobs-through-messages

Spring XD and Oracle RDBMS

I am newbie to Spring XD. I have a requirement to parse a file in a specific directory and push the output in oracle table.
Can I achieve that in Spring XD?
If not directly, can I create Spring boot/integration/batch application and deploy the same on Sprig XD?
Thanks,
Pratik
If I understood correctly, you want to deploy an ETL process on SpringXD.
Yes, this is possible, in fact, I once worked on that.
Spring Integration is ok with springXD and the things you should do is to adjust some parts of the context.
You can use task module in springXD to do ETL
Thanks for the inputs folks!
Well, I have learned Spring Batch framework and I am building the tasklets to manage my workflow to support my usecase.
Further, I am The resultant Jar of Spring Batch app to SpringXD as a Custom Module and scheduled it for a daily run.
I learnt from the research on this usecase that SpringXD is superset of and includes Spring Batch, Integration and Boot frameworks respectively; so
I kept the involvement of SpringXD as limited to Scheduling a batch job by adding custom module.
Thanks a lot for your support.
Cheers & Happy Architecting,
Pratik

spring-integration-kafka annotation support & example

Although new to spring, I'm usually able to get started with a spring projects fairly well with annotations only. The official examples uses xml without mentioning where they will be placed etc.
Is there any sample project on reading from a kafka topic? Preferably by using annotation to set the zk & kafka configuration properties.
Please, take a look to the Spring Integration Java DSL project and here is a KafkaTests to demonstrate how to be for your case.
Plus here you are Josh Long's article: https://spring.io/blog/2015/04/15/using-apache-kafka-for-integration-and-data-processing-pipelines-with-spring

groovy and spring getting started guide

I am looking to learn to gr1oovy with spring framework to access the database. I googled didn't find getting started code for spring and groovy.
Is there similar code for spring and groovy like below url.
hibernate+groovy
If you are developing a web application, the Grails framework is a good choice to start with.
Since Spring4 now can use groovy as the project language, you can really just rewrite any java examples to groovy.
Check out this spring-boot sample:
https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-data-jpa

Resources