jsr352 | Implementation of Jakarta Batch Specification and API | Continuous Deployment library

 by   jberet Java Version: 2.1.1.Final License: EPL-2.0

kandi X-RAY | jsr352 Summary

kandi X-RAY | jsr352 Summary

jsr352 is a Java library typically used in Devops, Continuous Deployment, Docker applications. jsr352 has build file available, it has a Weak Copyleft License and it has high support. However jsr352 has 66 bugs and it has 3 vulnerabilities. You can download it from GitHub, Maven.

JBeret is an implementation of Jakarta Batch. It is also included in WildFly, the new and improved JBoss Application Server to provide portable batch processing support in Jakarta EE environment.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              jsr352 has a highly active ecosystem.
              It has 114 star(s) with 72 fork(s). There are 15 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 18 open issues and 34 have been closed. On average issues are closed in 55 days. There are 16 open pull requests and 0 closed requests.
              OutlinedDot
              It has a negative sentiment in the developer community.
              The latest version of jsr352 is 2.1.1.Final

            kandi-Quality Quality

              OutlinedDot
              jsr352 has 66 bugs (3 blocker, 2 critical, 52 major, 9 minor) and 1085 code smells.

            kandi-Security Security

              jsr352 has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              OutlinedDot
              jsr352 code analysis shows 3 unresolved vulnerabilities (3 blocker, 0 critical, 0 major, 0 minor).
              There are 7 security hotspots that need review.

            kandi-License License

              jsr352 is licensed under the EPL-2.0 License. This license is Weak Copyleft.
              Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.

            kandi-Reuse Reuse

              jsr352 releases are available to install and integrate.
              Deployable package is available in Maven.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              jsr352 saves you 14184 person hours of effort in developing the same functionality from scratch.
              It has 28849 lines of code, 1894 functions and 497 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed jsr352 and discovered the below as its top functions. This is intended to give you an instant insight into jsr352 implemented functionality, and help decide if they suit your requirements.
            • Runs the job
            • Executes remove queries
            • Executes SQL statements
            • Gets the JdbcRepository from the given repository
            • Create tables
            • Helper method to add prefixes
            • DDL file location
            • Returns all the job executions in the database
            • Returns a job instance by its id
            • Get the script content
            • Returns the number of jobs in the specified job
            • Count step start times
            • Insert a job instance
            • Retrieves the partition executions for the given step
            • Find the original step execution
            • Insert job execution
            • Insert a job
            • Initializes the caches for the job
            • Starts the job execution
            • Returns a single job execution
            • Returns all the job instances for the given job name
            • Determine if the given job execution should be selected
            • Updates job status
            • Select step execution by id
            • Return the executions of the specified job
            • Create the thread pool executor
            Get all kandi verified functions for this library.

            jsr352 Key Features

            No Key Features are available at this moment for jsr352.

            jsr352 Examples and Code Snippets

            No Code Snippets are available at this moment for jsr352.

            Community Discussions

            QUESTION

            JSR352 decide next step based on return parameter from Decider
            Asked 2019-Dec-06 at 14:44

            I would like to implement a Decider that returns the ID of the next step that needs to be executed. (This question is related to my other question here if you would like to know why I'm trying to do this: JEE Batch Job Specification with many optional Steps)

            ...

            ANSWER

            Answered 2019-Dec-06 at 14:28

            To do this you'd need to know the possible target steps ahead of time...

            The JSL gets parsed up front (mostly) so there's nothing you can put in the 'to' value that would resolve with a result from the step/decider processing.

            Might be an interesting spec update possibility.

            Source https://stackoverflow.com/questions/59214372

            QUESTION

            How to identify an exception(which is happened from ItemReader, readItem method) in ItemWriter
            Asked 2018-Dec-04 at 18:23

            In JSR352 batch, I am running a partitioned step to create multiple JSON objects. Each thread, reads some data from oracle and write as JSON object. In some cases, the resultSet.next() getting timed out and throws an exception and going to close() method of ItemReader and ItemWriter class to cleanup any resources. which is perfectly fine. However I have some dao calls on close() method of writer. which needs to be executed when the writer gets completed. But when there's an exception on ItemReader, I am not sure how to get the exception details on close() method. If the exception occured on ItemReader, close() method should not execute the DAO call. Is there anyway to identify ItemReader exception in ItemWriter class.

            ...

            ANSWER

            Answered 2018-Dec-04 at 18:23

            If you have an ItemReadListener defined it will get control in the onReadError method, so you'd know you had an exception in the ItemReader. You could then put some flag into an object in the StepContext transient user data (setTransientUserData( )). In the ItemWriter close method you could get the transient user data out of the Step Context and act accordingly depending on what was in there.
            Or just set the flag from a catch block in the ItemReader to handle anything thrown from within the readItem.

            Source https://stackoverflow.com/questions/53618236

            QUESTION

            How to get configured retryable/skippable exceptions in jsr352
            Asked 2018-Nov-19 at 15:52

            I'd like to write some generic batch listeners to log out some useful information of all batches configured in my application. To do so I'd like to get the configured skippable/retryable exceptions from batch configuration. However I did not find any API for that. Is there a way to retrieve this configuration independant of the jsr352 implementation?

            ...

            ANSWER

            Answered 2018-Nov-19 at 15:52

            No you won't see this or anything similar really in the specification API (so anything that did exist would be impl-specific).

            The theme of separation of concerns lies behind many of the API choices, and nothing like a "job definition model" API exists in the spec.

            Source https://stackoverflow.com/questions/53375925

            QUESTION

            configuring dev and prod datasource in liberty dynamically to load based on the environment
            Asked 2018-Nov-17 at 17:12

            I am running java batch(jsr352) using liberty server. The datasource configured in server.xml. I would like to load server.xml based on the region(like dev, sit, prod). How can I pass arguments to start liberty server and load the datasource dynamically There could be possiblity with server.env file and bootstrap.properties. since new to this.. can anyone help on this.

            ...

            ANSWER

            Answered 2018-Nov-16 at 21:26

            An easy way to do this is to use variables in your server.xml like this:

            Source https://stackoverflow.com/questions/53345343

            QUESTION

            jsr 352 batch with retryable and skippable exception may processes items many times
            Asked 2018-Nov-16 at 20:44

            I have a batch implemented with JSR-352 (using jberet on wildfly).

            I have a chunk with item-count 15 and java.lang.Exception is configured as retryable and skippable exception.

            When there are many exceptions, most of the items will be processed multiple times. In this extreme case all items would throw an exception in the writer:

            • First 15 items are read
            • Exception occurs on first item
            • Chunk is rolled back and configured with item-count = 1
            • First item is read
            • Exception occurs again, item is skipped
            • Proceed with the other 14 items, exception may occur on every item, every item is skipped
            • After the first 15 items the chunk is back with item-count = 15
            • Items 16-30 are read
            • Exception occurs again
            • Reader is rolled back to latest checkpoint

            At this point there is still no checkpoint because there was no successful processed item yet. Hence the reader starts with the first item again. All 30 items are processed with item-count = 1. etc.

            If there are many such failures the batch would process all items again and again.

            I think the checkpoint needs to be set also for skipped items because a skipped item should not be processed again.

            I think this is a bug in the specification so I already opened an issue there: https://github.com/WASdev/standards.jsr352.batch-spec/issues/15 Or am I wrong and have misunderstood the implementation?

            How is this implemented in Spring Batch?

            ...

            ANSWER

            Answered 2018-Nov-16 at 20:44

            I think the specification is clear enough, which suggests this could be a JBeret bug (assuming it's not an application issue).

            In the spec (an unofficial version here), the section:

            8.2.1.4.3 Retry and Skip the Same Exception

            says that during a retry with rollback, the items are processed one-at-a-time, (in one-item chunks), and that skip takes precedence during retry.

            So if a skippable exception occurs during retry, that item would just be skipped, and an updated checkpoint should be persisted. This is how WebSphere Liberty Batch, the JSR 352 implementation I work on, does it.

            So I'd suggest producing a recreate project and opening a JBeret issue if it still looks like one. At this point, I don't see a spec issue.

            Source https://stackoverflow.com/questions/53339694

            QUESTION

            Design of JSR352 batch job: Is several steps a better design than one large batchlet?
            Asked 2018-Jul-30 at 13:27

            My JSR352 batch job needs to read from a database, and then depending on the result flows to one of two pathways, each of which involves some more if/else scenarios. I wonder what the pros and cons between writing a single step with a large batchlet and several steps consisting of smaller batchlets would be. This job does not involves chunk steps with chunk size larger than 1, as it needs to persists the read result immediately in case there is any before proceeding to other logic. The job will be run using Control-M, I wonder if using multiple smaller steps provides more control points.

            ...

            ANSWER

            Answered 2018-Jul-30 at 13:27

            From that description, I'd suggest these

            Benefits of more, fine-grained steps 1. Restart

            After a job failure, the default behavior on restart is to begin executing at the step where the previous job execution failed. So breaking the job up into more steps allows you to avoid writing the logic to resume where you left off and avoid re-processing, and may save execution time in the process.

            2. Reuse

            By encapsulating a discrete function as its own batchlet, you can potentially compose other steps in other jobs (or even later in this job) implemented with this same batchlet.

            3. Extract logic into XML

            By moving the transition logic into the transition elements, and extracting the conditional flow (e.g. , etc.) into the job definition XML (JSL), you can introduce changes at a standard control point, without having to go into the Java source and find the right place.

            Final Thoughts

            You'll have to decide if those benefits are worth it for your case.

            One more thought

            I wouldn't automatically rule out the chunk step just because you are using a 1-item chunk, if you can still find benefits from the checkpointing or even possibly the skip/retry. (But that's probably a separate question.)

            Source https://stackoverflow.com/questions/51572148

            QUESTION

            JSR352 - Single item read, multiple item write
            Asked 2018-Jul-18 at 19:53

            In a project I'm working on we are reading a file in which every item (a record) read represents a variable number of items to be written in a destination database. This apparently seems to break the pattern of JSR352 by inflating a single chunk more than expected.

            Does anyone has ever experienced this kind of problem? If yes, how has it been solved?

            ...

            ANSWER

            Answered 2018-Jul-18 at 19:04

            You can have a container object to hold all sub-items expanded from the single record in the input source. And the accumulated list of container objects will be passed to the item writer to write out to destination. You have full control of how the item writer works by implementing your own item writer class. For instance, the item writer class can write multiple records into destination.

            Source https://stackoverflow.com/questions/51408791

            QUESTION

            Authorization issues with batch OSGi app in Glassfish - "The current user is not authorized to perform this operation"
            Asked 2018-Mar-01 at 15:20

            I've already deployed an OSGi maven application with many OSGi bundles under Glassfish 4.1.2. This bundles are activated with a webapp that makes some calls with Jobs defined on it. All this is actually working in the expected way.

            The web app executes the jobs and jobs make the calls to the OSGi bundles. The problem comes when I try to get the Batch Status from outside.

            The purpose is to deploy other web application with REST webservices, so I can query the batch status on demmand. When I run:

            ...

            ANSWER

            Answered 2018-Mar-01 at 14:13

            As I'm working on a OSGi enviroment, first redeployed (undeployed manually and deployed one by one) all OSGi bundles again, and finally, redeployed (undeployed and deployed) the webapplication where the webservice lies, and then, it started working.

            It seems that the OSGi dependencies were not recognized in some way after making some redeployments, causing the security issue.

            Source https://stackoverflow.com/questions/47656558

            QUESTION

            How to run Java Batch (JSR352) in java SE environment?
            Asked 2017-Sep-18 at 05:20

            I have developed a java batch program using the JSR352 implementation (javax.batch.api.*)

            What is the best way to run this java batch program in a Java SE environment ?

            ps: We can deploy this program to a JEE server having JSR352 implementation but, we are looking for methods to run in a Java SE environment, where i can run the java program as a simple console application.

            ps2: i have the javaee-api-7.0.jar in my project classpath.

            ...

            ANSWER

            Answered 2017-Sep-18 at 05:20

            This approach worked. I was able to run a java batch in Java SE but, not sure how optimized this JSR352 implementation could be relied for Production grade jobs & data volume.

            http://www.mastertheboss.com/javaee/batch-api/running-batch-jobs-in-j2se-applications

            and

            Standalone example on jberet (jsr352)

            Source https://stackoverflow.com/questions/46239289

            QUESTION

            Is Java Batch (JSR 352) part of the SE JDK ? (BatchRuntime returns NULL for Joboperator)
            Asked 2017-Sep-15 at 14:01

            I have written a Java batch application using the JSR352 implementation from JavaSE. I have a Reader, Processor and Writer.

            Since am running this java app from console in a JavaSE environment, I use the following code in my main(String[] args) method to start the job.

            ...

            ANSWER

            Answered 2017-Sep-15 at 10:32

            The javax.batch.* APIs, though part of the EE 7 platform, were designed to be usable in SE (they don't inherently require a full EE platform). However, they are not designated as part of the SE platform, so they are not going to be part of a JDK. You'd need to use a Java Batch implementation, such as SpringBatch, or the Reference Implementation.

            Source https://stackoverflow.com/questions/46236228

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install jsr352

            You can download it from GitHub, Maven.
            You can use jsr352 like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the jsr352 component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link