Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-7002

Activemq SchedulerBroker doSchedule can schedule duplicate jobIds leading to runtime exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.15.4
    • 5.15.5, 5.16.0
    • Broker, Job Scheduler
    • None
    • Java 8
      AMQ 5.15.4

    Description

      Under load we've observed that SchedulerBroker will attempt to schedule jobs using the same JobId.

      When JobScheduleView attempts to process these jobs we'll encounter an exception during the below put call:

      @Overridepublic TabularData getAllJobs() throws Exception {
      OpenTypeFactory factory = OpenTypeSupport.getFactory(Job.class); CompositeType ct = factory.getCompositeType(); TabularType tt = new TabularType("Scheduled Jobs", "Scheduled Jobs", ct, new String[] { "jobId" {color}}); TabularDataSupport rc = new TabularDataSupport(tt); List<Job> jobs = this.jobScheduler.getAllJobs(); for (Job job : jobs) {
      rc.put(new CompositeDataSupport(ct, factory.getFields(job))); }
      return rc;
      {color}}

      This can be triggered by clicking on the Schduled tab in the webconsole.

      The error only occurs due to duplicate JobIds.

      Debugging this error, we can see that two jobs with different payloads have the same JobId - this should not be allowed to occur.

      We need to ensure that JobIds are unique.

      Note:

      In test scenario virtual topics are in use, with two consumers.
      Redelivery plugin is also in use on the Broker.

      <plugins>
                  <redeliveryPlugin fallbackToDeadLetter="false" sendToDlqIfMaxRetriesExceeded="false">
                      <redeliveryPolicyMap>
                          <redeliveryPolicyMap>
                              <defaultEntry>
                                  <redeliveryPolicy backOffMultiplier="2" initialRedeliveryDelay="60000" maximumRedeliveries="20" maximumRedeliveryDelay="300000" useExponentialBackOff="true"/>
                              </defaultEntry>
                          </redeliveryPolicyMap>
                      </redeliveryPolicyMap>
                  </redeliveryPlugin>
              </plugins>

      Attachments

        1. AMQ7002-messageId.patch
          2 kB
          Jamie Mark Goodyear
        2. amq7002-master.patch
          8 kB
          Jamie Mark Goodyear

        Activity

          People

            gtully Gary Tully
            jgoodyear Jamie Mark Goodyear
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: