[Design of JBoss ESB] - Scheduling of services
by beve
Hi,
I've been working on creating a Web Service Listener that will poll a web service and then execute an action pipeline. We have no option but to poll very frequently to have a good enough response time, so the need to be able have a little more control over when a service is triggered emerged.
After having refactored the polling to be able to use it for the WSListener, I had a chat with TomF about this matter and this a suggestion for scheduling of services.
Below is an example of what a configuration of scheduling could look like (example is from the helloworld_file_action quickstart):
| <fs-listener name="FileGateway"
| busidref="helloFileChannel"
| maxThreads="1"
| is-gateway="true">
| <property name="cronExpression" value="0/30 * * * * ?" />
| <property name="startDate" value="07-07-08 19:17:00" />
| <property name="endDate" value="07-07-08 19:20:00" />
|
| <!-- or simply specify
| <property name="pollLatencySeconds" value="10" />
| <property name="repeatCount" value="6" />
| -->
|
| </fs-listener>
|
The properties startDate and endDate are optional, aswell as the repeatCount if one want's to specify a pollLatencySeconds like you can do in the current code base.
The scheduling uses Quartz and the cronExpression is a Quartz CronExpression.
An AbstractScheduler that extends AbstractThreadedManagedLifecycle has been created which can be "inserted" into the inheritence chain, which is what has been done for AbstractFileGateway. I didn't want to have to refactor too much of the code and this felt like way to not have to.
This is the first time I've used Quartz so if anyone has used it before it would be great if you could take a look:)
This would not only let services like gateways and listener so be scheduled, it should be usable for other types of service that to not need to call an action pipeline, like BAM services for gathering statistics for example.
This can be found in the workspace http://anonsvn.jboss.org/repos/labs/labs/jbossesb/workspace/dbevenius/wsl... if anyone feels like trying it out. Just do a normal build and then start the jbossesb-server, then run the helloworld_file_action quickstart.
Any suggestions, additional requirements and comments are welcome.
Thanks,
Daniel
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061748#4061748
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061748
18 years, 9 months
[Design of JBoss ESB] - Re: Filters and meta-data modificatins
by mark.little@jboss.com
>From the Programmers Guide on meta-data and filters ...
anonymous wrote :
| JBossESB ships with org.jboss.internal.soa.esb.message.filter.MetaDataFilter and org.jboss.internal.soa.message.filter.GatewayFilter which add the following meta-data to the Message as Properties with the indicated property names and the returned String values.
|
| org.jboss.soa.esb.message.transport.type --> File, FTP, JMS or SQL.
| org.jboss.soa.esb.message.source --> The name of the file from which the message was read.
| org.jboss.soa.esb.message.time.dob --> The time the message entered the ESB, e.g., the time it was sent, or the time it arrived at a gateway.
| org.jboss.soa.esb.mesage.time.dod --> The time the message left the ESB, e.g., the time it was received.
| org.jboss.soa.esb.gateway.original.file.name --> If the message was received via a file related gateway node, then this element will contain the name of the original file from which the message was sourced.
| org.jboss.soa.esb.gatway.original.queue.name --> If the message was received via a JMS gateway node, then this element will contain the name of the queue from which it was received.
| org.jboss.soa.esb.gateway.original.url --> If the message was received via a SQL gateway node, then this element will contain the original database URL.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061642#4061642
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061642
18 years, 9 months