jberet

Java batch: jobContext transientUserData not passed through steps

自作多情 提交于 2021-02-05 08:53:06
问题 I'm using JBeret implementation of jsr-352 specs. This is my job configuration, in short: <job id="expired-customer-cancellation" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/jobXML_1_0.xsd" version="1.0" jsl-name="job-parent" parent="job-parent"> <step id="step1" next="step2"> <chunk item-count="#{jobParameters['chunksize']}?:3"> <reader ref="eccReader

JBeret - Batchlet Metrics not supported?

耗尽温柔 提交于 2021-01-29 10:44:54
问题 While I started using JBeret being the embedded JSR-352 engine in Wildfly, I notice that for some of my workload the chunk pattern does not apply. Simple enough I just wrapped it into batchlets and they are running ok. Now I'd like to collect metrics the same style as chunks do but there seems no method to increase existing metrics introduce new metrics What am I missing? 回答1: Batchlet is used to model task that is a single unit of work. If your workload is iterative in nature and needs

CDI not working with Java EE Batch under jberet implementation

二次信任 提交于 2020-01-03 03:01:19
问题 I have a Java EE batch application implemented with jberet deployed on WildFly application server. This application also expose a REST api to trigger a job on demand. I have following class creating beans to be injected: public class Factory { @Produces public JsonValidator getJsonValidator() { return JsonSchemaFactory.byDefault().getValidator(); } Injecting the above bean in the REST api works fine: @Path("my-resource") public class MyResource{ @Inject private JsonValidator jsonValidator;

JSR 352: Wildfly9 / JBeret - How to call a batch job that it is not contained at the same deployment file level

纵然是瞬间 提交于 2019-12-13 12:36:44
问题 I have a WAR application that includes a JAR library. The JAR library contains the Batch Job and the Batch Artifacts ( META-INF/batch-jobs/... ). The WAR app includes this jar as a library and defines a JAX-RS Service that allows to clients to invoke the batch job calling the JobOperator Interface... When i run this deployment, the JSR 352 implementation (JBeret) keeps complaining that the Job cannot be found anyware when the JobOperator Interface is called... However, if the Batch Job and

WELD-001409: Ambiguous dependencies for type StepContext with qualifiers @Default

橙三吉。 提交于 2019-12-11 17:30:02
问题 I am trying to run this example in java SE mode from my windows command prompt. I have built a jar with all dependencies included in it and running it from my command prompt. but, keep getting this error. From this answer, i understand that there could be multiple StepContext classes in my runtime classpath. i now replaced the maven-assembly plugin with the maven-shade plugin to build my fat jar and i can see the following warning while packaging the jar [WARNING] javax.inject-1.jar, weld-se

JSR 352: Wildfly9 / JBeret - How to call a batch job that it is not contained at the same deployment file level

点点圈 提交于 2019-12-06 11:10:24
I have a WAR application that includes a JAR library. The JAR library contains the Batch Job and the Batch Artifacts ( META-INF/batch-jobs/... ). The WAR app includes this jar as a library and defines a JAX-RS Service that allows to clients to invoke the batch job calling the JobOperator Interface... When i run this deployment, the JSR 352 implementation (JBeret) keeps complaining that the Job cannot be found anyware when the JobOperator Interface is called... However, if the Batch Job and the Batch Artifacts are included as classes of the WAR deployment, everything runs smoothly... So, what

How to put in custom scope/context (JobScoped - custom CDI scope) particular instance from request to make it injectable?

本小妞迷上赌 提交于 2019-12-03 09:51:46
问题 Saying in a nutshell I would like to put in custom scope particular instance of Configuration class from rest request. Main problem is that custom scope (JobScoped from JBeret https://jberet.gitbooks.io/jberet-user-guide/content/custom_cdi_scopes/index.html) is eligable after job starts. I know that there is possibility to add properties when starting job but my Configuration class agregates a lot of configurations and it's quite complicated so it would by very uncomfortable to convert this

How to put in custom scope/context (JobScoped - custom CDI scope) particular instance from request to make it injectable?

余生长醉 提交于 2019-12-03 01:29:56
Saying in a nutshell I would like to put in custom scope particular instance of Configuration class from rest request. Main problem is that custom scope (JobScoped from JBeret https://jberet.gitbooks.io/jberet-user-guide/content/custom_cdi_scopes/index.html ) is eligable after job starts. I know that there is possibility to add properties when starting job but my Configuration class agregates a lot of configurations and it's quite complicated so it would by very uncomfortable to convert this files to Properties class. Details below: This is rest request pseudocode: @Path("/job") public class

JSR352 JBeret - Error while running SleepyBatchlet using JBeret

。_饼干妹妹 提交于 2019-12-02 17:04:54
问题 I am trying to run a JSR352 compliant java batch program in Java SE mode using JBeret implementation. I took the SleepyBatchlet program, converted to a executable JAR (with all necessary dependencies packaged along with it) to use Jberet and tried running it from my windows command prompt but, got this error stack trace. The same project runs without any error from my Eclipse IDE I have checked to see the jdk version used in Eclipse and Command prompt is the same. Here is the exception when i

JSR352 JBeret - Error while running SleepyBatchlet using JBeret

南楼画角 提交于 2019-12-02 07:46:24
I am trying to run a JSR352 compliant java batch program in Java SE mode using JBeret implementation. I took the SleepyBatchlet program, converted to a executable JAR (with all necessary dependencies packaged along with it) to use Jberet and tried running it from my windows command prompt but, got this error stack trace. The same project runs without any error from my Eclipse IDE I have checked to see the jdk version used in Eclipse and Command prompt is the same. Here is the exception when i run java -jar jarfilename.jar Exception 0 : org.jboss.weld.exceptions.DeploymentException: WELD-001409