Features
The Quartz Service-Engine schedules jobs to trigger services invocations within the JBI bus. The jobs are based on time policies.
Concretely, when a job is triggered, the Quartz component sends a pre-defined message to execute the target service.
This component only acts as a service consumer and does not act as a service provider.
This component relies on the Quartz open source project.
For more details about Quartz usage, visit its website at http://www.quartz-scheduler.org/
Recommended usage
This component should be used to plan and launch service execution at determined moments.
As an example, you can use it to execute a given service every day at noon, or execute another service every 3 hours...
Each service-unit consumes one service, i.e. manages the invocation of one JBI service based a time (CRON) expression.
General information
Since this component only supports consuming configurations, no WSDL is required.
However, the messages sent by this component must respect the WSDL of the invoked service.
One way to ensure that is to generate the message's XML skeleton from the WSDL of the target service.
A tool like SoapUI works well for this kind of task.
The messages sent by this component are sent with the InOnly pattern.
It is not possible to add file attachments in the sent messages. These messages only have an XML payload.
This message is sent every time the time expression is reached.
Time expressions are CRON expressions. The syntax is explained on the website of the Quartz project.
Below are given some sample CRON expressions and their meaning.
| CRON expression |
Meaning |
| 0 0 12 * * ? |
Fire at 12pm (noon) every day. |
| 0 15 10 ? * * |
Fire at 10:15am every day. |
| 0 15 10 * * ? 2005 |
Fire at 10:15am every day during the year 2005. |
| 0 * 14 * * ? |
Fire every minute starting at 2pm and ending at 2:59pm, every day. |
| 0 0/5 14 * * ? |
Fire every 5 minutes starting at 2pm and ending at 2:55pm, every day. |
| 0 0/5 14,18 * * ? |
Fire every 5 minutes starting at 2pm and ending at 2:55pm, AND fire every 5 minutes starting at 6pm and ending at 6:55pm, every day. |
| 0 0-5 14 * * ? |
Fire every minute starting at 2pm and ending at 2:05pm, every day. |
| 0 10,44 14 ? 3 WED |
Fire at 2:10pm and at 2:44pm every Wednesday in the month of March. |
| 0 15 10 ? * MON-FRI |
Fire at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday. |
| 0 15 10 15 * ? |
Fire at 10:15am on the 15th day of every month. |
| 0 15 10 L * ? |
Fire at 10:15am on the last day of every month. |
| 0 15 10 ? * 6L |
Fire at 10:15am on the last Friday of every month. |
| 0 15 10 ? * 6L |
Fire at 10:15am on the last Friday of every month. |
| 0 15 10 ? * 6L 2002-2005 |
Fire at 10:15am on every last friday of every month during the years 2002, 2003, 2004 and 2005. |
| 0 15 10 ? * 6#3 |
Fire at 10:15am on the third Friday of every month. |
| 0 0 12 1/5 * ? |
Fire at 12pm (noon) every 5 days every month, starting on the first day of the month. |
Component Configuration
This component has no specific parameter in its configuration.
It only has the inherited ones from the CDK.
Unable to render {include} Couldn't find a page to include called: 0 CDK Component Configuration Table
Service Configuration
Service Unit Descriptor
The Quartz component is configured with a CRON expression, a service to call and an XML message request to send to the service.
You have to deploy a Service Unit with a JBI descriptor containing a consumes section with the right parameters.
Here is a sample of a SU JBI descriptor to call a Hello service with <text>hello</text> message, at 10:15am every day during the year 2005.
<?xml version="1.0" encoding="UTF-8"?>
<jbi:jbi version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:quartz="http://petals.ow2.org/components/quartz/version-1"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:generatedNs="http://petals.ow2.org/components/hello/version-3.0">
<jbi:services binding-component="false">
<jbi:consumes
interface-name="generatedNs:Hello"
service-name="generatedNs:HelloSrv"
endpoint-name="HelloSrvEndpoint">
<petalsCDK:operation>sayHelloOperation</petalsCDK:operation>
<petalsCDK:mep>InOnly</petalsCDK:mep>
<quartz:cron-expression>0 15 10 * * ? 2005</quartz:cron-expression>
<quartz:content><![CDATA[
<text>hello</text>
]]></quartz:content>
</jbi:consumes>
</jbi:services>
</jbi:jbi>
A JBI descriptor for a Quartz service-unit can only define one consumes block.
Configuration of a Service Unit to create a scheduler into Petals ESB:
| Parameter |
Description |
Default |
Required |
| cron-expression |
A CRON expression, for example 0 30 10-13 ? * WED,FRI: trigger that fires at 10:30, 11:30, 12:30, and 13:30, on every Wednesday and Friday. |
- |
Yes |
| content |
The XML message to send to the scheduled service. Must be included in a CDATA section, as shown in the sample jbi.xml above. |
- |
Yes |
Configuration of a Service Unit to consume a service (JBI)
| Parameter |
Description |
Default |
Required |
| consumes |
Refer JBI service to invoke into the JBI bus.
You can define an explicit endpoint: interface (QName) / Service (QName) / Endpoint (String) attributes.
Or define implicit endpoint, to let the container routing according to QOS configurations (HA...):
-by Interface attribute (QName)
-by Service attribute (QName) |
- |
Yes |
Configuration of a Service Unit to consume a service (CDK)
| Parameter |
Description |
Default |
Required |
| mep |
Message exchange pattern abbreviation. This parameter can be used in conjunction with the method of the CDK Listeners: createMessageExchange(Extensions extensions).
This method returns a CDK Exchange corresponding to the type of the specified pattern. |
- |
Yes |
| operation |
Operation to call on a service. This parameter can be used in conjunction with the sending methods of the Listeners. If no operation is specified in the Message Exchange to send, this parameter will be used. |
- |
No |
| timeout |
Timeout in milliseconds of a synchronous send. This parameter can be used in conjunction with the sendSync(Exchange exchange) method of the Listeners. Set 0 for an infinite timeout. |
30000 |
No |
Unable to render {include} Couldn't find a page to include called: 0 CDK Interceptor configuration for SU
Service Unit content
The service unit must only contain the JBI descriptor.
The directory structure of a SU for the Petals-SE-Quartz looks like this:
|
No contributors found for: authors on selected page(s)
|