From 5f477efcf804d98b4674fbd4770af4f9d1fa5704 Mon Sep 17 00:00:00 2001 From: Tadayoshi Sato Date: Wed, 8 Jan 2025 20:40:59 +0900 Subject: [PATCH] fix(quartz): fail to fire triggers manually with exception "job does not exist" Fix #1049 --- packages/hawtio/src/plugins/quartz/quartz-service.ts | 10 +++++----- .../plugins/quartz/triggers/TriggersManualModal.tsx | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/hawtio/src/plugins/quartz/quartz-service.ts b/packages/hawtio/src/plugins/quartz/quartz-service.ts index d67339729..50f6a466e 100644 --- a/packages/hawtio/src/plugins/quartz/quartz-service.ts +++ b/packages/hawtio/src/plugins/quartz/quartz-service.ts @@ -1,8 +1,8 @@ import { eventService } from '@hawtiosrc/core' import { AttributeValues, MBeanNode, jolokiaService, workspace } from '@hawtiosrc/plugins/shared' import { getQueryParameterValue } from '@hawtiosrc/util/urls' -import { JolokiaRequest } from 'jolokia.js' import Jolokia from '@jolokia.js/simple' +import { JolokiaRequest } from 'jolokia.js' import { attributeService } from '../shared/attributes/attribute-service' import { jmxDomain, log } from './globals' @@ -345,15 +345,15 @@ class QuartzService { }) } - async triggerJob(schedulerMBean: string, name: string, group: string, parameters: string) { + async triggerJob(schedulerMBean: string, jobName: string, jobGroup: string, parameters: string) { await jolokiaService.execute(schedulerMBean, QUARTZ_OPERATIONS.triggerJob, [ - name, - group, + jobName, + jobGroup, parameters === '' ? {} : JSON.parse(parameters), ]) eventService.notify({ type: 'success', - message: `Manually fired trigger: ${group}/${name}`, + message: `Manually fired trigger: ${jobGroup}/${jobName}`, }) } } diff --git a/packages/hawtio/src/plugins/quartz/triggers/TriggersManualModal.tsx b/packages/hawtio/src/plugins/quartz/triggers/TriggersManualModal.tsx index 6806af679..212df4a48 100644 --- a/packages/hawtio/src/plugins/quartz/triggers/TriggersManualModal.tsx +++ b/packages/hawtio/src/plugins/quartz/triggers/TriggersManualModal.tsx @@ -26,11 +26,11 @@ export const TriggersManualModal: React.FunctionComponent<{ } const { objectName } = selectedNode - const { name, group } = input + const { name, group, jobName, jobGroup } = input const fireTrigger = () => { log.info('Manually fire trigger:', objectName, input, parameters) - quartzService.triggerJob(objectName, name, group, parameters) + quartzService.triggerJob(objectName, jobName, jobGroup, parameters) clear() }