-
1. Re: Custom admin console for esb parameters
tcunning Mar 30, 2010 3:07 PM (in response to massios)1 of 1 people found this helpfulI believe there's a feature request for that already :
https://jira.jboss.org/jira/browse/JBESB-1429
Please add a vote for it.
-
2. Re: Custom admin console for esb parameters
massios Mar 31, 2010 6:50 AM (in response to tcunning)I voted for the jira-issue and I am watching it.
It would be nice if any changes made using the mbean are not lost every time the server is restarted.
If the cron expression is initialised using jboss-esb.xml every time the server is started then any changes will be lost unless the mbean also changes the xml. Right?
Nikos
-
3. Re: Custom admin console for esb parameters
massios Apr 13, 2010 11:19 AM (in response to massios)This is some information we discovered today. The scheduler
<schedule-provider name="scheduler1">
<cron-schedule cronExpression="0 50 11 * * ? *"
scheduleid="cron-trigger1" />
</schedule-provider>
In the jboss-esb.xml is named “scheduler1”
However the quartz scheduler job is not named after the schedule provider but gets its name instead using this method
org.jboss.soa.esb.schedule.SchedulerJob
private static String getJobName(){
final long id ;
synchronized(SchedulerJob.class) {
id = ++jobCounter ;
}
return JOB_NAME + id ;
}
We have managed to discover all the jobs in our ESB (!!!OUR_ESB_NAME!!!.esb) and to change the quartz cron trigger for the one quartz cron trigger job. The code here is just test code. Our problem is mainly that we cannot connect the jboss-esb.xml job with the cron trigger job. For the time being it will work because we have just one cron trigger but this is not safe. Also we still have the problem that every time the esb will restart the old cron schedule will be used.
public String listAllJobs() {
try {
SchedulerFactory sf = new StdSchedulerFactory();
Scheduler scheduler = sf.getScheduler("ESBScheduler:!!!OUR_ESB_NAME!!!.esb");
System.out.println("scheduler " + scheduler.getSchedulerName());
String[] jobGroups;
String[] jobsInGroup;
jobGroups = scheduler.getJobGroupNames();
for (int i = 0; i < jobGroups.length; i++) {
String currentGroup = jobGroups[i];
System.out.println("Group: " + currentGroup
+ " contains the following jobs");
jobsInGroup = scheduler.getJobNames(currentGroup);
for (int j = 0; j < jobsInGroup.length; j++) {
String currentJob = jobsInGroup[j];
System.out.println("- " + currentJob);
Trigger[] jobTriggers;
jobTriggers = scheduler.getTriggersOfJob(currentJob, currentGroup);
for(int k=0; k< jobTriggers.length; k++){
Trigger currentTrigger = jobTriggers[k];
if( currentTrigger instanceof CronTrigger){
System.out.println("-- Triggers " + currentTrigger.getFullJobName());
System.out.println("-- Triggers " + currentTrigger);
CronTrigger trigger = (CronTrigger) currentTrigger;
trigger.setCronExpression("0 50 12 * * ? *");
scheduler.rescheduleJob(currentJob,currentGroup, trigger);
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
I think that some serious consideration has to take place about whether it would be better to hold the cron-schedule for jobs and the directories for ftp-provider or fs-provider outside the jboss-esb.xml as jboss-esb.xml is a “static” resource but the information in it is of a more dynamic nature.