Spring Batch Java annotated - restart example - spring-boot

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

Related

Azure Active Directory in Spring App Without Boot

I have been trying to set up a Spring Web application to use Azure Active Directory.
All the samples that I have found online are based on Spring Boot, is there a simple example that shows setting up spring framework web app only without using Spring Boot?
I am having no luck finding stuff, I am also trying to figure out how to convert all the spring boot autoconfig. Surely there is a sample somewhere that makes it easy to use for a Spring Framework only web-app?
I was able to figure this out somewhat. I'm very new to OAuth so still trying to learn as I go.
Basically I followed the Spring Reference and got things working using the override auto-configuration sections at https://docs.spring.io/spring-security/reference/servlet/oauth2/index.html
It also helped that I updated the Spring Framework versions to the latest and made sure I used the correct dependencies according to that reference site

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 boot + Activiti explorer

Is it possible to integrate activiti explorer maven plugin with activiti Spring boot app?, so that we can make use of activit-explorer to view deployed process in activit-spring boot engine.
I know we can use rest-api over spring boot to query process engine, but I want to know if it is possible to run the explorer over spring boot by adding it as a maven plugin during deployment?Or can we tweak the activit-explorer.war somehow to point to spring-boot activiti engine?
activiti-explorer.war is standalone webapp by itself. I've write some guideline on how to manually to embed activiti-explorer to you own app. http://blog.canang.com.my/2016/05/12/embedding-activiti-explorer-to-your-application/
Most probably step 5 in my blog is your solution.
btw, there's reason why the name is 'default'. I can't recall it atm
I thought of answering my own question so that it will be useful for other developers with similar requirement. If you want to make an eco-system where activiti-rest, explorer and your custom end points co-exist, please refer this thread from activit forum. I have tried this and is working fine. link to thread
I would like to give my observation here. In order to avoid getting into pulling source and trying to build myself, I achieved partial success, by installing the activit-explorer as part of the usual standalone installation.Started the standalone activiti-explorer using Apache-Tomcat but I configured the database for Activiti as same as (MYSQL in my case) I used in my spring-boot application to hit the common ground.
But apparently the activiti version in my spring boot app was 5.19.0.0 and that for activiti-explorer was 5.22.0.0, which created some misalignment for spring boot application startup to fail. I am hopeful that with matching versions it might succeed. When I get some more time on me I will try and update. Since then may be someone can use this route.

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

Create sample application using spring version 2.5

I want to start with new scratch application using spring 2.5, I want to integrate hibernate also in same project, can anyone suggest ideas?
If you want to go down the Spring Boot road, there is plenty of documentation available:
First of all, check out this part of the documentation.
Next you can check out this sample application, as well as this sample application. Note that the aforementioned samples use Hibernate implicitly though the use of JPA.
You can also take a look at this blog post.

Resources