View Source

{section}
{column}

{warning}This version must be installed on [Petals ESB 5.3.0|petalsesb530:Petals ESB 5.3.0]+{warning}

h1. Scheduling service invocations (Consumes mode)

h2. Usage

This component permits to scheduled service provider invocations.

The messages sent by this component are sent with the *InOnly* pattern. No response is expected from the service provider.
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|http://www.quartz-scheduler.org/]. This Petals component is based on Quartz version 2.3.2.
Below are given some sample CRON expressions and their meaning.

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.

{column}
{column:width=25%}
{panel:title=Table of contents}{toc:outline=true}{panel}
{panel:title=Contributors}{contributors:order=name|mode=list|showAnonymous=true|showCount=true|showLastTime=true}{panel}
{column}
{section}

|| 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. |

h2. Service Unit Configuration

All needed information must be defined in the service-unit JBI descriptor. This JBI descriptor is configured through parameters divided in following groups:
* *JBI parameters* that defines the service consumer identification,
* *CDK parameters* that are parameters driving the service consumer implementation at CDK layer,
* *CDK interceptor parameters* that are parameters driving interceptors at CDK layer,
* *Dedicated parameters* that are parameters driving the service consumer implementation at component layer.

A JBI descriptor for a Quartz service-unit can only define one _consumes_ block.

h3. CDK parameters defining service consumer implementation
The following parameters correspond to the CDK configuration of the service consumer implementation.

{include:0 CDK SU BC Consume Configuration 5.8.0}

h3. CDK parameters driving interceptors
The following parameters drive interceptors at CDK layer.

{include:0 CDK SU Interceptor configuration 5.8.0}

h3. Dedicated configuration
The following parameters correspond to the component specific configuration of the service consumer implementation.

{table-plus}
|| {center}Parameter{center} || {center}Description{center} || {center}Default{center} || {center}Required{center} || {center}Support placeholders{center} ||
| cron-expression | A CRON expression, for example {{0 30 10-13 ? * TUE,THU *}} that invokes the given service provider 10:30:00, 11:30:00, 12:30:00, and 13:30:00, on every Wednesday and Friday. | {center}-{center} | {center}Yes{center} | {center}Yes{center} |
| 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. | {center}-{center} | {center}Yes{center} | {center}No{center} |
{table-plus}

h2. Service-Unit content

The service unit has to contain the following elements, packaged in the archive:
* the META-INF/jbi.xml descriptor file as described above.

{code}
service-unit.zip
+ META-INF
- jbi.xml (as defined above)
{code}

h3. Example

An example of a Service Unit descriptor to provide a service scheduled at 10:15:00am, every day, in 2005 to invoke the service provider {{Hello}} with the mesage {{<text>hello</text>}}:
{code:lang=xml}
<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="true">
<jbi:consumes
interface-name="generatedNs:Hello"
service-name="generatedNs:HelloSrv"
endpoint-name="HelloSrvEndpoint">

<!-- CDK specific elements -->
<petalsCDK:operation>sayHelloOperation</petalsCDK:operation>
<petalsCDK:mep>InOnly</petalsCDK:mep>

<!-- Component specific elements -->
<quartz:cron-expression>0 15 10 * * ? 2005</quartz:cron-expression>
<quartz:content><![CDATA[
<text>hello</text>
]]></quartz:content>
</jbi:consumes>
</jbi:services>
</jbi:jbi>
{code}

h1. Configuring the component

The component can be configured through the parameters of its JBI descriptor file. These parameters are divided in following groups:
* *JBI parameters* that have not to be changed otherwise the component will not work,
* *CDK parameters* that are parameters driving the processing of the CDK layer,
* *Dedicated parameters* that are parameters specific to this component.

h2. CDK parameters
The component configuration includes the configuration of the CDK. The following parameters correspond to the CDK configuration.

{include:0 CDK Component Configuration Table 5.8.0}

h2. Interception configuration
{include:0 CDK Component Interceptor configuration 5.8.0}

h2. Dedicated configuration

No dedicated configuration parameter is available.

h1. Business monitoring

h2. MONIT traces

{include:0 CDK BC Business Monitoring Traces 5.8.0}

h2. Flow tracing activation

{include:0 CDK BC Provides Business Monitoring Flow Tracing Activation 5.8.0}

h1. Monitoring the component

h2. Using metrics

Several probes providing metrics are included in the component, and are available through the JMX MBean '{{org.ow2.petals:type=custom,name=monitoring_*<component-id>*}}', where {{*<component-id>*}} is the unique JBI identifier of the component.

h3. Common metrics

{include:0 CDK Component Monitoring Metrics 5.8.0}

h3. Dedicated metrics

No dedicated metric is available.

h2. Receiving alerts

Several alerts are notified by the component through notification of the JMX MBean '{{org.ow2.petals:type=custom,name=monitoring_*<component-id>*}}', where {{*<component-id>*}} is the unique JBI identifier of the component.

{tip}To integrate these alerts with Nagios, see [petalsesbsnapshot:Receiving Petals ESB defects in Nagios].{tip}

h3. Common alerts

{include:0 CDK Component Monitoring Alerts 5.6.0}

h3. Dedicated alerts

No dedicated alert is available.