New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quartz / quartz2 plugin #786
Comments
Agreed. Incidentally I'd really like a Fabric Timer; which used ZK to determine who was going to execute a collection of timers. The partition stuff can do this kinda thing already really: http://jboss-fuse.viewdocs.io/fuse/partition I figure we could just define timers in property files; then let the Fabric Partition stuff make sure only 1 machine was running 1 set of timers at a time; then we just need a little bit of eye candy on the Partition stuff (to see which container is running what sets of timers) and to make it easy to edit the timer info? |
Is there a way I can contribute to this plugin ? I'm so interested in it. |
Yeah sure. hawtio uses JMX API to integrate (though jolokia turns these JMX apis into REST). So the 1st step would to take a look at quartz and see what JMX APIs it offers. Then another step would be able to build the source code and run hawtio on your computer. For that follow the steps on the how to build the code You dont need to go full and do integration testing and whatnot. I dont do that. But the live reload is cool so you can do live changes. Though if you have some problems with this, then its faster to get help on IRC where we hang out, and can help asap. |
On for sure, we love contributions! :) Which bit did you fancy working on; the hawtio UI for working with quartz 2; or the back end for quartz which used the Fuse partition stuff? (Am guessing the former?) I guess the first thing we'd need is a little example project to create a few quartz timers so there's something for the hawtio plugin to visualise/manage? e.g. we maybe need an example-quartz service module here: so folks can easily run quartz2 stuff and see the mbeans; then we can try work on a quartz plugin |
For a plugin as inspiration, then you may take a look at the tomcat plugin, which was the first plugin I improved/wrote AFAIR. Its a fairly simple plugin, and has a few sub tabs. And presents some data from tomcat. So maybe the first step is to be able to show information about the quartz scheduler, such as its version number, its state, and maybe other details. And a table with all its jobs, and then later buttons to change these jobs etc. |
And you have configured the quartz component in your camel blueprint.xml file to use your quartz.properties file? eg it needs to know its location on the classpath. |
No, I havent. I expected that it searched the classpath, including my packages exported. So, I have to explicitly configure the quartz component....... I'll try and come back. |
Oki. This is what I have in my blueprint :
This is what I have in my route :
If I use quartz in my route then I receive this error :
What am I doing wrong ? |
You need to use a recent JAR of camel-quartz / camel-quartz2 to have that working in OSGi blueprint, eg to configure the propertiesFile option. See CAMEL-7140 |
Yeah build 321 should have CAMEL-7140 included. Ah spotted it. Make sure you use the same quartz component. In the blueprint its quartz 1.x. Maybe use quartz2 as its the newer. 1.x is EOL. Notice the bean id is quarz2 which is the component name Camel uses.
|
I've changed what you said.... but the result is the same : Error occurred during starting Camel: CamelContext(simple) due Failed to create route route20: Route(route20)
|
The stacktrace also contains :
It seems the problem is that the system does not find the properties file..... |
Do your bundle export the package: com/tesipro/conectores/expedia |
Is it possible that the quartz component is just trying to open the properties file via new File(propertiesFile); and not look on the classpath? Maybe it's worth specifying an absolute path to the location of the file on your filesystem in the blueprint XML. |
I've tried that already, and not works either. |
Hi, <bean id="bridgePropertyPlaceholder" class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>file:src/main/resources/not_packaged_in_archive/dev/camel-dev.properties</value>
</list>
</property>
<property name="ignoreResourceNotFound" value="true" />
</bean> ...and my routes are running fine. I read the conversation trail above. Is it necessary for me to declare my quartz properties in a different file and declare it as : <bean id="quartz2" class="org.apache.camel.component.quartz2.QuartzComponent">
<property name="propertiesFile" value="file:etc/quartz.properties"/>
</bean> |
If you do not use latest release of Camel, you need to enable JMX on quartz yourself. In the quartz properties file set org.quartz.scheduler.jmx.export=true |
Cheers! Worked when I did the following :
<bean id="quartz2" class="org.apache.camel.component.quartz2.QuartzComponent">
<property name="propertiesFile" value="file:src/main/resources/not_packaged_in_archive/dev/quartz.properties"/>
</bean>
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 3
org.quartz.scheduler.jmx.export=true But, I'm using the Google Chrome hawtio extension. When I change the cron and click on "Update Trigger", it doesn't work. |
So we can manage the quartz scheduler from the web ui.
Would need to investigate what management api if all quartz offers. As quartz 1.x and 2.x API is so different, we may choose to support quartz2 at first, and then if possible quartz 1 later.
The text was updated successfully, but these errors were encountered: