Announcement Announcement Module
No announcement yet.
Endtime not set on StepExecution Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Endtime not set on StepExecution

    Hi all,
    I'm using a combined job and step listener annotated with @afterStep and @afterJob. When I'm callbacked in afterStep the endtime is null on the StepExecution. When I'm callbacked in afterJob the end time IS set on the corresponding stepExecution. Anyone who knows anything bout it?

    br Svante

    Spring Batch 2.1.9

  • #2
    See this old issue:
    In short, it's a design decision to leave the step's end time null until after it finishes processing its afterStep listeners.

    Me, I'd say "after step" would mean after the step is done, but to the designers, it means "after most of the step, except for this listener callback I'm doing now, is done."

    The issue discussion above talks of no good reason for wanting the end time in the step during the callback, but here's a real one: auditing. I want to update an auditing monitor in realtime as my steps complete. I'm auditing performance. The end time combined with the start time gives me duration, a real measure of performance.

    I've worked around by approximating the end time by just generated a new Date() in my impl of afterStep(), which is the value I send to my monitor, but this complicates testing of the afterStep method.


    • #3
      Thanks for the reply. I have the same issue, i need to update an external system used to (among other things) keep track of execution times. Guess I'll go for the new Date() blues...

      br Svante