spring batch - Couldn't receive values in destination step using ExecutionContextPromotionListener -
I want to give some information from step one step to second in batch job. BStepListener has been created where the value is stored in the context, but this same value is not coming in another step in the [SendMailTasklet] functional. Where am I missing?
Job Configuration
& lt; Job ID = "eBay" xmlns = "http://www.springframework.org/schema/batch" & gt; & Lt; Step id = "step 1" & gt; & Lt; Tasklet & gt; & Lt; Chuck Reader = "BRDER" author = "BWRitter" processor = "B processor" commit-interval = "10" /> & Lt; / Tasklet & gt; & Lt; Batch: on next = "COMPLETED" to "sendEmail" /> & Lt; Listeners & gt; & Lt; Audience Riff = "Bistlestner" /> & Lt; Listener Riff = "bPromotionListener" /> & Lt; / Listeners & gt; & Lt; / Step & gt; & Lt; Step id = "sendEmail" & gt; & Lt; Task ref = = "sendmail manager" /> & Lt; / Step & gt; & Lt; / Work & gt; & Lt; Bean id = "Bitlestustner" class = "com.listener.bistlistner" scope = "step" /> & Lt; Bean id = "bPromotionListener" class = "org ... Executing Communication Communicator" & gt; & Lt; Property name = "keys" value = "message" /> & Lt; / Bean & gt; & Lt; Bean id = "sendMailManager" class = "com.mail.SendMailTasklet" scope = "step" & gt;
BStepListener.java
Public exit stops (Step Execution Step Execution) {System.out.println ("Step Performance Listener ... after ..."); String Message = "A sample message for step by step"; StepExecution.getExecutionContext () Put ("msg", message); Return tap; }
SendMailTasklet.java
Execute public recurrence status (Phase Edit Contribution, ChunkContest Chuck Contante) throws exception {logger.info ("sending email service .... "); String Message = (String) Chunkcontex .getStepContext (). GetJobExecutionContext (). Get ("msg"); This.sendMail (); Repeat the return Status.FINISHED; } I think that (I'll have to double check the code) that we order listeners.
You can see Composite Stage Execution Listener
More about here Can read:
Comments
Post a Comment