-
Apr 23rd, 2008, 05:09 PM
#1
Spring Batch Job Control - JMX JConsole
Hi all, I am relatively new to the batch spring framework and our team is currently working on a POC.
We are evaluating the Spring Batch Framework under various key criteria features. I am currently wondering if there are any tips/best practices for enabling a Spring Batch simple job to be EXPOSED and monitored by JConsole. I know this can be done via Spring. But any samples on this more Spring Batch related.
If I embed exporter and mBeanExporter under my settlementJob simple job is this the right approach?
<bean id="settlementJob" parent="simpleJob">
...
<bean id="exporter" class="o.sf.jmx.expoert.MBeanExporter">
<property name="settlementJob">
<map>
<entry key="cgi:service=settlementService">
<ref local="service"/>
</entry>
</map>
</property>
<property name="namingStrategy" ref="pocNamingStrategy"/>
</bean>
<bean id="mbeanExporter" class="o.sf.jmx.expoert.MBeanExporter">
<property name="autodetect">
<value>true</value>
</property>
<property name="namingStrategy" ref="pocNamingStrategy"/>
</bean>
Thanks!
-
Apr 23rd, 2008, 09:12 PM
#2
Have you looked at the adhoc-job-launcher-context.xml? It should provide a good example of how to configure JMX.
-
Apr 24th, 2008, 04:26 PM
#3
I took a look at the adhoc-job-launcher-context.xml and managed to get it up and running. I also successfuly connect via my local JConsole and I'm pretty happy about that - so far I like what I see 
My current concern is how to actually wire it into my current job as it's kicked off by the CommandLineRunner?
My Batch Job:
main class:
org.springframework.batch.execution.launch.support .CommandLineJobRunner
sample Ad hoc:
org.springframework.batch.sample.TaskExecutorLaunc her
Do I have to change my jobs entry point to kick off using the TaskExecutor and update the -context.xml to include a MBeanExporter bean as that seems to be tied into the SimpleExportedJobLauncher which I think should be updated to reflect CommandLinJobRunner?
-
Apr 25th, 2008, 02:43 AM
#4
The idea is that you use TaskExecutorLauncher instead of CommandLineJobRunner. Use the config file for that as a template, and replace the hard-coded job configurations with your versions. And remember it's only a sample.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules