You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2024/03/09 10:34:00 UTC

(activemq) branch activemq-5.18.x updated: [AMQ-9450] Expose Job Scheduler views with destination via JMX

This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch activemq-5.18.x
in repository https://gitbox.apache.org/repos/asf/activemq.git


The following commit(s) were added to refs/heads/activemq-5.18.x by this push:
     new c3ff7ef07 [AMQ-9450] Expose Job Scheduler views with destination via JMX
c3ff7ef07 is described below

commit c3ff7ef072d3b13ae185fffc85fe20397773b61b
Author: Matt Pavlovich <ma...@apache.org>
AuthorDate: Thu Mar 7 15:41:10 2024 -0600

    [AMQ-9450] Expose Job Scheduler views with destination via JMX
    
    (cherry picked from commit 81e6b90ac8f4354279cb00356232bfde4ccd1f31)
---
 .../activemq/broker/jmx/JobSchedulerView.java      | 15 ++++++++
 .../activemq/broker/jmx/JobSchedulerViewMBean.java | 42 ++++++++++++++++++++++
 2 files changed, 57 insertions(+)

diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/JobSchedulerView.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/JobSchedulerView.java
index 92dfe9277..2f05b7f6e 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/JobSchedulerView.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/JobSchedulerView.java
@@ -54,6 +54,11 @@ public class JobSchedulerView implements JobSchedulerViewMBean {
 
     @Override
     public TabularData getAllJobs() throws Exception {
+        return getAllJobs(false);
+    }
+
+    @Override
+    public TabularData getAllJobs(boolean includeDestinationName) throws Exception {
         OpenTypeFactory factory = OpenTypeSupport.getFactory(Job.class);
         CompositeType ct = factory.getCompositeType();
         TabularType tt = new TabularType("Scheduled Jobs", "Scheduled Jobs", ct, new String[] { "jobId" });
@@ -67,6 +72,11 @@ public class JobSchedulerView implements JobSchedulerViewMBean {
 
     @Override
     public TabularData getAllJobs(String startTime, String finishTime) throws Exception {
+        return getAllJobs(startTime, finishTime, false);
+    }
+
+    @Override
+    public TabularData getAllJobs(String startTime, String finishTime, boolean includeDestinationName) throws Exception {
         OpenTypeFactory factory = OpenTypeSupport.getFactory(Job.class);
         CompositeType ct = factory.getCompositeType();
         TabularType tt = new TabularType("Scheduled Jobs", "Scheduled Jobs", ct, new String[] { "jobId" });
@@ -100,6 +110,11 @@ public class JobSchedulerView implements JobSchedulerViewMBean {
 
     @Override
     public TabularData getNextScheduleJobs() throws Exception {
+        return getNextScheduleJobs(false);
+    }
+
+    @Override
+    public TabularData getNextScheduleJobs(boolean includeDestinationName) throws Exception {
         OpenTypeFactory factory = OpenTypeSupport.getFactory(Job.class);
         CompositeType ct = factory.getCompositeType();
         TabularType tt = new TabularType("Scheduled Jobs", "Scheduled Jobs", ct, new String[] { "jobId" });
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/JobSchedulerViewMBean.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/JobSchedulerViewMBean.java
index 9aedbefc7..61c92f172 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/JobSchedulerViewMBean.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/JobSchedulerViewMBean.java
@@ -97,6 +97,19 @@ public interface JobSchedulerViewMBean {
     @MBeanInfo("get the next job(s) to be scheduled. Not HTML friendly ")
     public abstract TabularData getNextScheduleJobs() throws Exception;
 
+    /**
+     * Get all the jobs scheduled to run next.
+     *
+     * @param includeDestinationName
+     *        include the destination name with the job metadata.
+     *
+     * @return a list of jobs that will be scheduled next
+     *
+     * @throws Exception if an error occurs while reading the scheduler store.
+     */
+    @MBeanInfo("get the next job(s) to be scheduled including the destination name. Not HTML friendly ")
+    public abstract TabularData getNextScheduleJobs(boolean includeDestinationName) throws Exception;
+
     /**
      * Get all the outstanding Jobs that are scheduled in this scheduler store.
      *
@@ -107,6 +120,19 @@ public interface JobSchedulerViewMBean {
     @MBeanInfo("get the scheduled Jobs in the Store. Not HTML friendly ")
     public abstract TabularData getAllJobs() throws Exception;
 
+    /**
+     * Get all the outstanding Jobs that are scheduled in this scheduler store.
+     *
+     * @param includeDestinationName
+     *        include the destination name with the job metadata.
+     *
+     * @return a table of all jobs in this scheduler store.
+     *
+     * @throws Exception if an error occurs while reading the store.
+     */
+    @MBeanInfo("get the scheduled Jobs in the Store including the destination name. Not HTML friendly ")
+    public abstract TabularData getAllJobs(boolean includeDestinationName) throws Exception;
+
     /**
      * Get all outstanding jobs due to run between start and finish time range.
      *
@@ -122,6 +148,22 @@ public interface JobSchedulerViewMBean {
     @MBeanInfo("get the scheduled Jobs in the Store within the time range. Not HTML friendly ")
     public abstract TabularData getAllJobs(@MBeanInfo("start: yyyy-MM-dd hh:mm:ss")String start,@MBeanInfo("finish: yyyy-MM-dd hh:mm:ss")String finish)throws Exception;
 
+    /**
+     * Get all outstanding jobs due to run between start and finish time range.
+     *
+     * @param start
+     *        the starting time range to query the store for jobs.
+     * @param finish
+     *        the ending time of this query for scheduled jobs.
+     * @param includeDestinationName
+     *        include the destination name with the job metadata.
+     *
+     * @return a table of jobs in the range given.
+     *
+     * @throws Exception if an error occurs while querying the scheduler store.
+     */
+    @MBeanInfo("get the scheduled Jobs in the Store within the time range including the destination name. Not HTML friendly ")
+    public abstract TabularData getAllJobs(@MBeanInfo("start: yyyy-MM-dd hh:mm:ss")String startTime, @MBeanInfo("finish: yyyy-MM-dd hh:mm:ss")String finishTime, boolean includeDestinationName) throws Exception;
     /**
      * Get the number of messages in the scheduler.
      *