Announcement Announcement Module
Collapse
No announcement yet.
Default JobParameters Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Default JobParameters

    I wish to declare a step-scoped listener, common to many jobs which prepends its logging statements with a job-specific tag (i.e. "JOB1 : chunk committed"). The simplest configuration for the common listener is to configure as:
    Code:
    <bean ... scope="step" p:logToken="#{jobParameters[logToken]}" />
    There are a few more reductions that I am planning around the same pattern if someone can help explain how to achieve it!

    The "logToken" job property is essentially "static". I want each job to declare it alongside the job itself such that no invoker of the job (JobLauncher, Quartz or anything else) has to specify or know about it.

    How do I do this? On perhaps a related note, can I define a set of default JobParameters?

  • #2
    You can do that with a simple custom wrapper for the JobLauncher, right? JobParametersIncrementer and JobParametersValidator might also be relevant. Or, if all you need is the job name, you can simply use a different late binding expression to pull that out at runtime: #{jobName} should work I think (from memory).

    Comment


    • #3
      Thanks, I'll look at those other classes. My requirement for success is that these "static" job parameters get added automatically no matter how the job is invoked.

      Comment

      Working...
      X