Announcement Announcement Module
No announcement yet.
question on the CommandLineJobRunner Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • question on the CommandLineJobRunner

    Base on my observation , spring batch can seperate the job definition config from the container config. That is a very good way.

    But why does the CommandLineJobRunner only have one path argument?
    Does that mean I have to coupling my job definition config with the container config when I am using the CommandLineJobRunner ?

  • #2
    No, you don't have to put them in one file. You can use either imports to combine multiple contexts, which is fine if you don't think you'll be changing references very often, or you can use another context file to tie them together, as we do in the samples project.


    • #3
      Yes, you are right. Now I am using another context file to tie them together. Thanks for ur advice.


      • #4
        the advantage of one file with imports over multiple files is that it forces you to think about the contents of your application context a little harder. the command line job runner uses autowiring to set properties and we all know how flaky autowiring can be in spring. i think that one file serves as a helpful reminder that all of these beans need to coexist.