Coder Social home page Coder Social logo

chrisgleissner / spring-batch-rest Goto Github PK

View Code? Open in Web Editor NEW
86.0 86.0 42.0 352 KB

REST API for Spring Batch using Spring Boot 2.2

License: Apache License 2.0

Java 99.95% Procfile 0.05%
batch batch-processing hateoas java java-11 java-8 rest rest-api spring-batch spring-boot spring-mvc swagger2

spring-batch-rest's People

Contributors

cg-exp avatar chrisgleissner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-batch-rest's Issues

500 error on getJobDetails quartz

Hey there, I don't have time to fix this so I figured I'd log some issues I found and some enhancement requests.

Calling /jobDetails/{quartzGroupName}/{quartzJobName}

For a job that doesn't exist returns a 500 error. I found the line it throws in the past, but can't recall - its pretty obvious - I think there is a filter that runs, then it calls .get(0) on the resulting structure which is empty, so it throws.

Also, {quartzGroupName} should now be made optional, and default to null. Internally, null will use the QuartzDefaultGroup, so if unspecified in the API/swagger would default to null=defaultGroup.

Ideally the API would return 404 with a response body indicating if the quartzGroupName was not found or if the quartzJobName was not found.

ERROR 500 with stacktrace when a job is lauched more than once.

Hello,
when I start a job with the same parameter it cause an error 500.
I think It would be nice not to fail in this case. but catch the error and display it.

Error on the client side.

{
  "timestamp": "2018-12-22T13:54:36.839+0000",
  "status": 500,
  "error": "Internal Server Error",
  "message": "Failed to start personJob",
  "trace": "java.lang.RuntimeException: Failed to start personJob\n\tat com.github.chrisgleissner.springbatchrest.util.adhoc.AdHocStarter.start(AdHocStarter.java:53)\n\tat com.github.chrisgleissner.springbatchrest.api.jobexecution.JobExecutionService.launch(JobExecutionService.java:74)\n...",
 "path": "/jobExecutions"
}

Error on the server

rg.springframework.batch.core.repository.JobInstanceAlreadyCompleteException: A job instance already exists and is complete for parameters={upperCase=true, additionalProp3=stringz, additionalProp2=string}.  If you want to run this job again, change the parameters.
	at org.springframework.batch.core.repository.support.SimpleJobRepository.createJobExecution(SimpleJobRepository.java:132) ~[spring-batch-core-4.1.0.RELEASE.jar:4.1.0.RELEASE]
...

JobConfig adaptations

Hi,

I want to propose 2 changes in JobConfig class, if possible:

  1. In my project I have to use jackson-core:2.9.9 to work properly with other dependencies. To avoid an exception in that version, JobConfig needs @NoArgsConstructor and @AllArgsConstructor annotations. Could be added?

  2. All the properties in JobConfig are String values (Map<String, String> properties), could you allow other types (i.e Map<String, Object> properties) ?

Disable quartz

Hello,

Is it possible to disable quartz? I just want to execute jobs by api request

mariadb backend

Hi Chris:

Thanks for your open-source work of spring-batch-rest.

I fork it on the github as a new project and then I make it compatible with spring boot 1.5.3(the current version we used for work). After I plug it in an existed spring batch/boot application with mariadb backend, when I visit http://localhost:8130/jobs, I expect I will get the jobs stored in mariadb(ie: BATCH_JOB_INSTANCE), but I get no one.

Can you please give me some advices to make this work?
Thanks in advance.

Add Parameter Information/Params to Quartz API Endpoints

Hey there, I don't have time to fix this or add the feature so I figured I'd log some things that would be good additions to the project.

Now that JobParameters can be specified for scheduled jobs, it would be pretty straightforward via the structures you've setup to expose these via the API, so you can see the parameters that a scheduled job is configured to run for.

Would also be pretty cool to add an optional parameter/body to specify job parameters for a scheduled job that you're initiating via the REST API.

Basic Authentication

Hi, do you have any intention of setting up some kind of authentication to enter the Swagger page?

Question: Quartz Group Name

The Quarz Group Name seems to be hard-coded to "group".

How does one change this?

I assume since its exposed through the rest API there is some way to override it.. but looking at the class I'm sort of dense when it comes to how to do it.

Thanks for any help!

Date job parameters provided as string

We'v a job that requires a creationDate as date parameter.

While JobParamUtil checks for date parameters, the issue seems to be that the properties map is never filled with date properties as the deserializer treats them as string by default.

Did I miss any way to force a date or is this feature currently not supported?

AdHocStarter ".start()" docs update

Looks like AdHocStarter takes a parameter "JobConfig" which is a member class of this library.

Docs state that this start() call takes generic Spring Batch Param types:

String, Job

Any information on how to correctly configure & use the JobConfig as a parameter to call start() would be very much appreciated.

Thanks for any help or clarification!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.