Uploaded image for project: 'Red Hat Decision Manager'
  1. Red Hat Decision Manager
  2. RHDM-760

Cannot specify ThreadSafeTrackableTimeJobFactoryManager by system property "drools.timerJobFactory"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 7.0.0.GA
    • 6.x.x
    • BRE
    • Workaround Exists
    • Hide

      Use SessionConfiguration.setTimerJobFactoryType() as written in Description.

      Show
      Use SessionConfiguration.setTimerJobFactoryType() as written in Description.

      In BRMS 6.4.6, System.setProperty("drools.timerJobFactory", "thread_safe_trackable") fails with IllegalArgumentException because THREAD_SAFE_TRACKABLE is not enlisted in resolveTimerJobFactoryType()

          Caused by: java.lang.IllegalArgumentException: Illegal enum value 'thread_safe_trackable' for TimerJobFactoryType
              at org.drools.core.TimerJobFactoryType.resolveTimerJobFactoryType(TimerJobFactoryType.java:80)
              at org.drools.core.SessionConfigurationImpl.init(SessionConfigurationImpl.java:172)
              at org.drools.core.SessionConfigurationImpl.<init>(SessionConfigurationImpl.java:125)
              at org.drools.core.SessionConfiguration$DefaultSessionConfiguration.<clinit>(SessionConfiguration.java:49)
              ... 6 more
      

      https://github.com/kiegroup/drools/blob/6.5.x/drools-core/src/main/java/org/drools/core/TimerJobFactoryType.java#L72-L81

      So, in order to use ThreadSafeTrackableTimeJobFactoryManager, we need to call SessionConfiguration.setTimerJobFactoryType().

          KieSessionConfiguration kconf = KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
          ((org.drools.core.SessionConfiguration)kconf).setTimerJobFactoryType( TimerJobFactoryType.THREAD_SAFE_TRACKABLE  );
          KieSession ksession = kContainer.newKieSession("ksession-rules", kconf);
      

            etirelli@redhat.com Edson Tirelli
            rhn-support-tkobayas Toshiya Kobayashi
            Tibor Zimányi Tibor Zimányi
            Tibor Zimányi Tibor Zimányi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: