i trying pass throttle limit jobparameter. before starting batch job need set no of threads , page size based on number of records need processed.
i using below config. giving error. `
<batch:step id="step2" next="step3"> <batch:tasklet transaction-manager="transactionmanager" task-executor="taskexecutor" throttle-limit="#{jobparameters['threadnumber']}"> <batch:chunk reader="pagingitemreader" writer="databaseitemwriter" processor="itemprocessor" commit-interval="#{jobparameters['chunksize']}" /> </batch:tasklet> </batch:step>` getting below error `
exception in thread "main" org.springframework.beans.factory.beancreationexception: error creating bean name 'step2': initialization of bean failed; nested exception org.springframework.beans.factory.beanexpressionexception: expression parsing failed; nested exception org.springframework.expression.spel.spelevaluationexception: el1008e:(pos 0): property or field 'jobparameters' cannot found on object of type 'org.springframework.beans.factory.config.beanexpressioncontext' - maybe not public? @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:547) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:475) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:302) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:228) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:298) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:193) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:684) @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:760) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:482) @ org.springframework.context.support.classpathxmlapplicationcontext.<init>(classpathxmlapplicationcontext.java:139) @ org.springframework.context.support.classpathxmlapplicationcontext.<init>(classpathxmlapplicationcontext.java:83) @ com.wdpr.payment.batch.batchapp.main(batchapp.java:37)
using schema configure won't work since does't allow set chunkorientedtasklet step scoped. you'd have manually configure step in order you're attempting.
you'd better off managing throttle limit in taskexecutor (making step scoped).
Comments
Post a Comment