Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-7105

How to get any configuration within the job context of a org.apache.karaf.scheduler.Job



    • Question
    • Status: Resolved
    • Minor
    • Resolution: Information Provided
    • 4.3.1
    • None
    • karaf



      I haven't posted questions about Karaf before, so sorry if this is the wrong place for them.. I also tried to subscribe to the karaf user mailing list so i can post my question there (as i thought it is the place for questions and general discussions), but my request is not yet approved, so not sure if i did it right at all. If possible, please give the correct steps to request such membership/subscription or if such requests take longer to process that's fine, i'll wait then.


      To the question. Following the karaf-scheduler-example for a Runnable service (https://github.com/apache/karaf/tree/main/examples/karaf-scheduler-example/karaf-scheduler-example-runnable) i implemented a similar Job-based service. Please see attached the Job itself and its pom.xml. I placed it in a module within the existing examples project only for local testing purpose, so please don't mind the official groupId/package..

      Then the job was executed 5 times as expected, but each time if i tried to read from the JobContext the configuration attribute, it is always null (org.apache.karaf.scheduler.JobContext#getConfiguration). I tried to figure out by looking at the scheduler sources (org.apache.karaf.scheduler.core.QuartzScheduler) how the job is scheduled, but couldn't find that there is any configuration set there in any case. Please tell me if i missed something, if such configuration would be available to the job implementor at all in any case, and what to expect there ?


      Hope you got my question..

      Thank you,


      Vassil Zorev


        1. SampleJob.java
          0.7 kB
          Vassil Zorev
        2. pom.xml
          2 kB
          Vassil Zorev



            jbonofre Jean-Baptiste Onofré
            vassilz Vassil Zorev
            0 Vote for this issue
            2 Start watching this issue