Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The document explains which classes have to be created and for which purpose. This example was developed with the use of Apache MQ.

Goal of the Example

The example covers the specifics to achieve the use case. It neither covers the complete job api nor the complete possibilities of JMS.

For the coverage of the JobScheduler job api refer to the XML part of the API Documentation.

For the coverage of the JMS api refer to the Oracle Java Documentation.

 The Use Case

The use case consists of the following steps:

  1. Run a Java Job in the JobScheduler which sends an XML fragment to a message queue (MQ) 
  2. Run a Java Job in the JobScheduler which receives an XML fragment from an MQ
  3. Execute an XML command in the JobScheduler

The Show Case???(How to name this better)

The steps described in this article are as follows:

  • How to implement a Java job using the job api
  • How to implement the Producer Job
  • How to implement the Consumer Job
  • How to execute an XML fragment using the job api
  • How to deploy the jobs to the JobScheduler
  • How to configure the JobScheduler Jobs with JOE using the developed classes

Prerequisites

To write a Java job for the JobScheduler the following dependency is needed.

  • engine-job-api.jar
    • The library is hosted on Maven Central. Please download the jar and add it to the classpath of the Java project. 
    • If your Java project is already a maven project, simply add the following dependency to the project configuration:
Code Block
languagexml
titleMaven Dependency for engine-job-api
collapsetrue
<dependency>
    <groupId>com.sos-berlin.jobscheduler.engine</groupId>
    <artifactId>engine-job-api</artifactId>
    <version>1.10.3</version>
</dependency>
    • Make sure to use the correct version suitable for th JobScheduler in use.

For this example the activemq-all-5.13.0.jar library is used.

  • Either download the jar file and add it to your classpath
  • or add the following dependency to the project configuration
Code Block
languagexml
titleMaven dependency for activemq-all
collapsetrue
<dependency>
    <groupId>org.apache.activemq</groupId>
    <artifactId>activemq-all</artifactId>
    <version>5.13.0</version>
</dependency>

...

The Basic Structure of an API Job Java Class


Implementation of the Producer Job

 

Implementation of the Consumer Job