We're in a 2-node cluster environment with various scheduled services. A new application has a requirement to run only one node once a day - our other scheduled apps are fine with running on both nodes and needs to stay that way. In this app's case, the scheduled service is duplicating data in a database due to it running twice daily vs. just once.
Can I modify my .sar's META-INF/jboss-service.xml (vs. having to modify any JBoss configuration) so this particular app only runs one node? Here's the existing .sar jboss-service.xml:
<?xml version="1.0" encoding="UTF-8"?> <server> <mbean code="org.jboss.varia.scheduler.Scheduler" name="com.mycompany.myapp:service=MyScheduledService"> <attribute name="StartAtStartup">true</attribute> <attribute name="SchedulableClass">com.mycompany.myapp.MyScheduledService</attribute> <attribute name="InitialStartDate">NOW</attribute> <attribute name="SchedulePeriod">86400000</attribute> <!-- every 24 hours --> <attribute name="InitialRepetitions">-1</attribute> <depends> jboss.jca:service=DataSourceBinding,name=jdbc/MyDataSource </depends> </mbean> </server>