Pages

Friday, 10 October 2014

Enterprise Scheduler Service ( ESS ) in SOA 12C





 Oracle Enterprise Scheduler:

Enterprise applications require the ability to respond to many real-time transactions
requested by online users or web services. However, they also require the ability to off
load larger transactions to run at a future time or automate the running of application
maintenance work based on a defined schedule.
Oracle Enterprise Scheduler provides the ability to run different job types, including:
Java, PL/SQL, binary scripts, web services and EJBs distributed across the nodes in an
Oracle WebLogic Server cluster. Oracle Enterprise Scheduler runs these jobs securely,
with high availability and scalability, with load balancing and provides monitoring
and management through Fusion Middleware Control.

Oracle Enterprise Scheduler provides scheduling services for the following purposes:
·         To distribute job request processing across a grid of application servers
·         To run Java, PL/SQL, binary process jobs, web services and EJBs
·         To group job requests into job sets
·         To schedule job requests based on recurrence expressions
·         To administer job requests with Fusion Middleware Control

Creating schedules via EM console. Click Job Requests -> Define Schedule.

a)      Activating and deactivating adapter deployed in SOA 
      Creating schedules for deactivating and activating a SOA deployed Adapter. This is very much helpful when there is need to stop certain adapters polling at peak loads etc.




Click Create.





Create a schedule for deactivating the adapter activation. Give Name, Package and start times.



Click Customize Times for giving end date.




Click Change Frequency if you want to change the scheduled times. Change the times and check the times that are scheduled.
                                      
                                      
                                      
                                      
Create one more schedule for enabling adapter activation.





So now we have both the schedules for activating and deactivating the adapter.

Create a SOA Composite with database adapter polling and deploy.


Click the DB adapter name in Services and References section. PollCustTable in above example.


There is a link for Adapter schedule as shown above foe scheduling activation and deactivation of adapter activation agent.


Here we can select the schedules which we have created earlier. Based on the usecase the schedules can be defined. For our testing purpose let us change the schedule to run for every 15 minutes to check whether polling is working in deactivation scheduled time.  So now edit the schedules.


Starting from 3:25 PM and for every 15 min adapter will go to an off state.



Starting from 3:22 PM and for every 15 min adapter will be turned on to accept polling from DB.

                                     
                                     

Let us populate our table to check the polling.

 Check that the data is picked by the SOA Composite                                                                                                             

Now at 3:22 PM the deactivation schedule starts and the DB adapter polling stops till the activation schedule at 3:25 PM. Let us see for every minute from 3:22 PM the status in DB whether message is picked or not.
                                   
                                   
                                   

At 3:25 the polling starts and the message(s) is/are picked from DB.
                              

We can check the instances to confirm the same. Based on the instances there are no instances between 3:21:52 PM to 3:25:13 PM where the deactivation schedule is on.                                                                          

On setting the activation and deactivation schedules on DB adapter, the Job definitions are automatically created with Job Type as SyncEjbJobType as shown below.

                             

b)      Invoking SOA Composite from ESS:

      Now we will see how can we invoke a SOA composite based on the scheduled times.
For this we will create a Job definition with Job Type as SyncWebserviceJobType                                    

Click Create
                            

 Give Name, DisplayName and Package and select Job Type.                                                                                            
After selecting the SyncWebserviceJobType, we have to provide the WSDL and the Webservice Type. Since we are trying to invoke a SOA Composite select the type as SOA.

                           

Give the endpoint WSDL of the SOA Composite as WSDL.                                                                                              

Now we will get the Port Type, select the one which you want to invoke and the input that need to be sent to SOA Composite.                                                                                                                                                                                                                                   

In the System Properties you will be able to see which PortType of SOA Composite it is invoking and the input etc.                                                                                                                                                                                                                                             

Now that we have created a Job Definition, let us create a Job Request which will initiate the Job definition created above.                                                                                                                                                                                                                                 

Select the Job Definition which you have created earlier and create a schedule if you want to invoke the SOA Composite recursively                                                                                                                                                                                             

Click Go to get all the Job definitions and select the one we created before to invoke SOA Composite.                                                                                                                                                                                                                                                       

Check in the system parameters what is the input that is getting passed.                                                                                                                                                       

Create schedule with start and end dates if required to invoke SOA Composite more than once.                                                                                                                 

Click Save Schedule checkbox to save the Schedule and to be reused for some other purpose.                                                                                                                                                                                               

Now we can confirm based on the scheduled time whether the SOA Composite is called by checking the instances of SOA Composite.                                                                                                                                                                                                                                                                                                                                                                             

In the audit trial, Check the input and confirm whether that is same as the one we provided earlier.                                                                                                           

We can search the Job Requests about the scheduler progression.

Since the input is hardcoded, the same input is sent for each invocation of SOA Composite and same input is processed multiple times by SOA Composite. To change this and get the input values at run time we can create Application defined properties and use them in the input.

Create Application defined properties by clicking plus sign and give the type. All the Integer values will be initialized to 0.
                          

Now edit the SYS_EXT_invokeMessage value by choosing edit option in System properties and give the application defined properties in the input as below.                                                                                         

In next blog we will see how can we invoke ESS from SOA Composite.