7

I have successfully configured our app to export Quartz's MBeans into JMX and can view everything in JConsole. I can run the majority of the scheduler operations.

The one I really want to run is 'triggerJob', but that is showing up in JConsole as greyed-out/disabled so I can't run it.

I've scanned the commits that added the JMX code to Quartz but can't see any differences between triggerJob and the other operations that are enabled.

Anyone have a clue what's going on?

EDIT - explanation found

A different StackOverflow issue describes what's going on: Why are some methods on the JConsole disabled

triggerJob (and two other operations) take non-primitive parameters, these complex parameters cannot be provided in JConsole.

I am not clear if the MBean provider might provide a custom editor for JConsole (or simlar), but at least I have my answer.

Community
  • 1
  • 1
  • BTW here's the definition for these methods: https://www.quartz-scheduler.org/api/2.3.0/org/quartz/core/jmx/QuartzSchedulerMBean.html#pauseJobsAll-- – ACV Jul 03 '23 at 10:06

1 Answers1

1

Thank you for your explanation. I have successfully triggered a job remotely through JMX using the following Groovy code:

def callParams = new Object[3]
callParams[0] = 'com.test.project.TestJob'
callParams[1] = 'DEFAULT_JOB_GROUP'
callParams[2] = new HashMap()

def callSignature = new String[3]
callSignature[0] = 'java.lang.String'
callSignature[1] = 'java.lang.String'
callSignature[2] = 'java.util.Map'

// server is an instance of MBeanServerConnection
server.invoke('triggerJob', callParams, callSignature)
Aston
  • 3,654
  • 1
  • 21
  • 18