Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Java job definition API as an alternative to XML #109

Open
m-reza-rahman opened this issue Jul 23, 2020 · 5 comments
Open

Add a Java job definition API as an alternative to XML #109

m-reza-rahman opened this issue Jul 23, 2020 · 5 comments

Comments

@m-reza-rahman
Copy link

The Batch API currently only supports defining jobs in XML. While this is workable, many developers prefer to provide configuration via Java instead of XML. This alternative is generally more concise, more type-safe and also allows for conditional configuration more easily. Hence, the Batch API should consider adding a Java job definition API as an alternative to XML. Some Batch API implementations already provide this option in non-standard ways.

Reza Rahman
Jakarta EE Ambassador, Author, Blogger, Speaker

Please note views expressed here are my own as an individual community member and do not reflect the views of my employer.

@scottkurz
Copy link
Contributor

Thanks for opening Reza.

I'm interested how batch properties would work with this type of API. E.g. would I be expected to call a setBatchProperty(name,value) for every single artifact that needed a given property or would there be some scoping mechanism involved. One angle I'm interested here in #95. At the moment BatchProperty injection values come via the XML-defined job property scope hierarchy, combined with job parameters passed on the execution start. But maybe some type of property bean with a specified scope would be helpful from both of these angles?

@rmannibucau
Copy link

What we did in batxhee is to generate a jaxb model of the dsl and let it be instantiated programmatically.
Can need some fluent love but is a good start.
With cdi, an option is to produce a jon directly.

@mminella
Copy link

mminella commented Aug 3, 2020

Before addressing this, I think adding generics back to the API would be a pre-req...

@scottkurz
Copy link
Contributor

Opened #177 since a job registration mechanism would make this API more useful, but it's probably not a hard dependency.

@scottkurz scottkurz removed this from the Batch 2.1 (proposed) - EE 10 milestone Dec 9, 2021
@scottkurz
Copy link
Contributor

Seems we're not going to get to this in 2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants