Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jakartabatch-dev] Kick off conversation on next Jakarta Batch release - Jakarta EE 10 ? Batch + CDI integration?

For me, option three is the way to go. It gives CDI users guarantees of what to expect in environments where CDI is available whilst not impacting non-CDI users and implementations. The CDI related items on the current issue list is a good representation of gaps seen in Batch when used in Jakarta EE runtimes.

I believe this is the approach used by Faces fairly successfully in supporting use in both Jakarta EE and non-Jakarta EE environments.

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.

On Mar 23, 2021, at 11:27 AM, Michael Minella <mminella@xxxxxxxxxx> wrote:


Thanks Scott for kicking this conversation off. As you noted in your comment, the decision for not requiring CDI was made at the time due to the interest in having Spring Batch implement the JSR without rewriting a large portion of Spring Batch. To be clear, I still see that this is the right approach. I'm not clear as to how requiring CDI at the spec level improves the experience for the user of this specification. We allow an implementation to require a specific DI implementation and that seems to work fine, giving the end users the type of choice, we would expect. I personally, would like to see a list of functionality we want to enable via CDI that is not available otherwise. Again, what does requiring CDI support do for the end user?  Keep in mind, the actual configuration of jobs/etc is completely independent of the CI infrastructure to the user.

You pose three options. The first one is to require CDI, the second (CDI is optional) is really what we currently have (no required changes), and the third then introduces this odd situation of requiring CDI only in specific situations that really doesn't help those who choose not to use CDI in the first place. For me, I only see choice one and two as the real options. I don't see any implementation that does not use CDI duplicating the effort both across their other DI of choice and CDI. To be 100% transparent, as Spring Batch evaluates the roadmap for Spring Batch 5 (built on top of Spring Framework 6, etc), we are actively considering depricating our implementation of JSR-352 and removing it in Spring Batch 6. The number of users consuming Spring Batch via the spec is too small to warrant the ongoing maintenance burden. Add to that, we were never able to fully validate our implementation due to the transaction pieces of the TCK being dependent upon the entire application server certification process (unable to run in an SE environment).

I'm happy to hop on a call on this topic if it will help in any way. Thanks!

From: jakartabatch-dev <jakartabatch-dev-bounces@xxxxxxxxxxx> on behalf of Romain Manni-Bucau <rmannibucau@xxxxxxxxx>
Sent: Tuesday, March 23, 2021 10:07 AM
To: jakartabatch developer discussions <jakartabatch-dev@xxxxxxxxxxx>
Subject: Re: [jakartabatch-dev] Kick off conversation on next Jakarta Batch release - Jakarta EE 10 ? Batch + CDI integration?
 
Hi Scott,

Maybe coming from nowhere but personally i'd like jbatch 2 to not inherit from jbatch 1 and be reactive driven.
Overall idea is to be able to use more easily custom flows (by combining CompletionStages).
This has a ton of advantages:

1. Makes the batch writer responsible of the flow (whereas a mix between the runtime and writer),
2. Keep the composability of existing batch "components",
3. Enables to work with any IoC without having to do any integration (batch writer injects what it needs),
4. No need of any batch/job repository (in code veritas est ;)),
5. Enables to be more efficient in more and more common "remoting first" batches we meet with microservices (ie leverage NIO more than in current synchronous API),
6. Makes the testing way easier: myBatch.userStart().toCompletionFuture().get();

The main missing piece is the persistence of the steps+overall batch state(s) and some controller (to stop a running batch for example).

Indeed JBatch 2 can be a BatchController { saveStepState(...); saveBatchState(...) } etc but thinking more in terms of events sounds more natural (we can start by CDI events since it is about jakarta but implementations can wire events on what they desire).

To rephrase it a bit more clearly: JBatch wouldn't be a runtime with very low value as of today but the actual infrastructure API (persistence mainly and state "isBatch(key, STOPPED)").

In terms of API the only small challenges are to enable to inject into a promise flow these persistent steps properly and to probably enable to orchestrate more easily chunking and so (even if Stream API kind of enables it but it misses some Iteration object to make it easier) but overally it does not sound crazy:

final var batch = jbatch.startingBatch("my-batch");
final var batchPromise = batch.wrapStep("step 1 name", fetchData())
  .thenApply(read -> batch.wrapStep("step 2 name", processData(read)));

and so on.

Does it make sense or is JBatch stucked on container+synchronous current design?

Romain Manni-Bucau
@rmannibucau |  Blog | Old BlogGithub | LinkedIn | Book


Le mar. 23 mars 2021 à 14:05, Scott Kurz <skurz@xxxxxxxxxx> a écrit :
Hi all,

I hope everyone is doing OK and making it through the pandemic as well as possible.

I'd like to kick off conversation on the next Batch release here.  It is finally time to look at adding new function ! 

While it's natural to approach this as "a Batch update for Jakarta EE 10",  I think we have to dive into discussion of the issues, build some momentum, and see what pace we can maintain before committing to any kind of plan.

But ideally a release should mix:
  1)  Major items        2)   Minor API enhancements/tweaks        3)  Other enhancements - e.g. automation / infrastructure / process, etc.

So in my mind that'd look something like:

Major items
* Better CDI integration -  (e.g. these issues as starting points:  https://github.com/eclipse-ee4j/batch-api/issues?q=is%3Aissue+is%3Aopen++cdi)
* Support for generics - https://github.com/eclipse-ee4j/batch-api/issues/13
* Support for Java-defined job (not just XML-defined) https://github.com/eclipse-ee4j/batch-api/issues/109
* Better Properties injection - https://github.com/eclipse-ee4j/batch-api/issues/133,   https://github.com/eclipse-ee4j/batch-api/issues/95, https://github.com/eclipse-ee4j/batch-api/issues/43,  https://github.com/eclipse-ee4j/batch-api/issues/82    (We probably should also be looking at MicroProfile Config and the future of MicroProfile + Jakarta convergence)
* Clarify Persistent user data https://github.com/eclipse-ee4j/batch-api/issues/131

Minor items   - We have a large list of suggestions piled up in:   https://github.com/eclipse-ee4j/batch-api/issues

Other
* Enhance the EE TCK in https://github.com/eclipse-ee4j/batch-tck so we can stop having to do a second, duplicate contribution to the https://github.com/eclipse-ee4j/jakartaee-tck/ possibly as the JUnit 4 extension Romain outlined which we haven't followed up on.
* Continue to plug gaps in TCK coverage and add new tests cases for old function
--------

So that's a big list and already likely more than could fit into a next release, given we're starting from a pace of zero.

However, I don't think we should go further, without first talking about Jakarta Batch + CDI integration.

The subject takes us back to the JSR 352 legacy where the Expert Group, including IBM, Pivotal / VMWare, and others, laid the groundwork for the collaboration by purposely not requiring use of a specific dependency injection technology, and so did not define Batch + CDI integration.    Anyone familiar with the JSR would observe, and we fully acknowledge the major portion of JSR 352 modeled after Spring Batch, and we have all appreciated and benefited from this contribution.

But I do think we need to reconsider this topic to make the right decision now for how to standardize Jakarta Batch + Jakarta CDI going forwards.   We should have this conversation upfront, before we invest more time in any of the other details.

E.g. some rough ideas would be:

1. Support for Jakarta Batch + CDI is required
2. Support for Jakarta Batch + CDI is optional
3. Support for Jakarta Batch + CDI is required, "in the presence of a CDI runtime"  (whatever that means, obviously would need clarification)

So for now I'm hoping to launch the discussion, and to take whatever time we need for those interested to join in.

Looking forward to hearing your thoughts,
------------------------------------------------------
Scott Kurz
WebSphere / Open Liberty Batch and Developer Experience
skurz@xxxxxxxxxx
--------------------------------------------------------

_______________________________________________
jakartabatch-dev mailing list
jakartabatch-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakartabatch-dev
_______________________________________________
jakartabatch-dev mailing list
jakartabatch-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakartabatch-dev

Back to the top