SOA Suite 12c: Using Enterprise Scheduler Service to schedule deactivation and activation of inbound adapter bindings

The Enterprise Scheduler Service that is available in Fusion Middleware 12.1.3 supports a number of administration activities around the SOA Suite. We will look at one particular use case regarding environment management using the ESS. Suppose we have an inbound database adapter. Suppose we have created the PortalSlotRequestProcessor SOA composite that uses a database poller looking for new records in a certain table PORTAL_SLOT_ALLOCATIONS (this example comes from the Oracle SOA Suite 12c Handbook, Oracle Press). The polling frequency was set to once every 20 seconds. And that polling goes on and on for as long as the SOA composite remains deployed and active.

Imagine the situation where every day during a certain period, there is a substantial load on the SOA Suite, and we would prefer to reduce the resource usage from non-crucial processes. Further suppose that the slot allocation requests arriving from the portal are considered not urgent, for example because the business service level agreed with our account managers is that these requests have to be processed within 24 hours – rather than once every 20 seconds. We do not want to create a big batch, and whenever we can, we strive to implement straight through processing. But between 1 and 2 AM on every day, we would like to pause the inbound database adapter.

In this section, we will use the Enterprise Scheduler Service to achieve this. We will create the schedules that trigger at 1 AM every day, used for deactivating the adapter, and 2 AM, used for activating the adapter. In fact, in order to make testing more fun, we will use schedules that trigger at 10 past the hour and 30 past the hour. These schedules are then associated in the Enterprise Manager Fusion Middleware Control with the inbound database adapter binding PortalSlotRequestPoller.

Create Schedules

An ESS Schedule is used to describe either one or a series of moments in time. A schedule can be associated with one or many Job definitions to come to describe when those jobs should be executed. A recurring schedule has a frequency that describes how the moments in time are distributed over time. A recurring schedule can have a start time and an end time to specify the period during which the recurrence should take place.

To create the schedules that will govern the inbound database adapter, open the EM FMW Control and select the node Scheduling Services | ESSAPP. From the dropdown list at the top of the page, select Job Requests | Define Schedules, as is shown in this figur

 

image

Click on the icon to create a new schedule. Specify the name of the schedule as At10minPastTheHour. Set the display name to “10 minutes past each hour”. The schedule has to be created in the package [/oracle/apps/ess/custom/]soa. This is a requirement for schedules used for adapter activation.

Select the frequency as Hourly/Minute, Every 1 Hour(s) 0 Minute(s) and the start date as any date not too far in the future (or even in the past) with a time set to 10 minutes past any hour.

image

Note that using the button Customize Times, we can have a long list of moments in time generated and subsequently manually modify them if we have a need for some exceptions to the pattern.

Click on OK to save this schedule.

Create a second schedule called At30minPastTheHour. The definition is very similar to the previous one, except for the start time that should 30 minutes past some hour.

image

Click OK to save this schedule definition.

Note that more sophisticated recurrence schedules can be created through the Java API exposed by ESS as well as through the IDE support in JDeveloper. These options that allow specific week days or months to be included or excluded can currently not set set through the EM FMW Control.

Apply Schedules for Activation and Deactivation of Inbound Database Adapter

Select node SOA | soa-infra | default | PortalSlotRequestProcessor – the composite we created in the previous chapter. Under Services and References, click on the PortalSlotRequestPoller, the inbound database adapter binding.

clip_image002

The PortalSlotRequestProcessor appears. Click on the icon for adapter schedules.

image

In the Adapter Schedules popup that appears, we can select the schedule that is to be used for deactivating and for activating the adapter binding. Use the At10minPastTheHour schedule for deactivation and At30minPastTheHour for activation. Press Apply Schedules to confirm the new configuration.

clip_image003

From this moment on, the inbound database adapter binding that polls table PORTAL_SLOT_ALLOCATIONS is active only for 40 minutes during every hour, starting at 30 minutes past the hour.

For example, at 22:14, the binding is clearly not active.

image

 

Test switching off and on of Database Adapter binding

When the schedules for activation and deactivation have been applied, they are immediately in effect. You can test this in the Dashboard page for the inbound database adapter binding, as is shown here

clip_image002[5]

Here we see how a single record was processed by the adapter binding, insert at 10:09PM. Four more records were inserted into table PORTAL_SLOT_ALLOCATIONS at 10:13 and 10:14. However, because the adapter binding is currently not active, so these records have not yet been processed.

image

image

At 30 minutes past the hour – 10:30 in this case – the adapter becomes active again and starts processing the records it will then find in the table. Because the adapter was configured to pass just a single record to a SOA composite and not process more than two records in a single transaction, it will take two polling cycles to process the four records that were inserted between 10:10 and 10:30. These figures illustrate this.

image

image

clip_image004

 

The SOA composite instances that are created for these four records retrieved in two poll cycles:

image

and the flow trace for the instance at 10:30:09 looks like this – processing two separate database records:

imageWhen you check in the ESS UI in EM FMW Control, you will find two new Job Definitions, generic Jobs for executing SOA Suite management stuff:

ess_adapteractivation1

In the Job Requests overview, instances of these jobs appear, every hour one of each. And the details of these job requests specify which adapter binding in which composite is the target of the SOA administrative action performed by the job.

ess_adapteractivation2

Setup for JMS resources in WebLogic (Chapter 6)

In Chapter 6, the use of the outbound JMS Adapter in SOA Suite is described. In order to implement the services described in the chapter, some setting up of JMS resources is required in your WebLogic Server. This article describes the steps you need to go through in terms of preparation, resulting in a JMS queue with a JNDI name of jms/finance/AircraftMovementsQueue in the SOAJMSModule and a Connection Factory called jms/finance/FinanceConnectionFactory in that same JMS Module.

Note: in real life you should be creating your own JMS Module instead of using the SOAJMSModule that SOA Suite uses itself. In the context of the book, to keep things simple, we will violate that rule.

Lees verder

Configuring Chat in SOA Suite 12c with the XMPP driver in the UMS Adapter

Chatting or instant messaging is a valuable for of communication, somewhere between email (very asynchronous) and telephone/Skype/VoiP/HangOut (synchronous) and quite similar to SMS. Unfortunately, there is has been an explosion in the number of IM protocols and services, many of which cannot talk to each other. Whatsapp is perhaps the most popular chat-like service, but it lives on its own. Google Talk (now assimilated into GMail and Google Hangouts) started as a relatively open service (based on the XMPP standard for IM), but is now largely proprietary. AOL, MSN, ICQ, Facebook, Skype, Twitter – many different largely closed networks within in which users can interact in char-style. But unfortunately hardly across which. Not like emails for example that float freely between domains, servers and vendor technologies.

Having said all that, XMPP is still supported by many tools and servers – and it is still used by large numbers of users. Not just for chatting, but for other types of push-style interaction. See this Slideshare presentation for a nice intro into XMPP. Note that it mentions some attempts to create gateways to connect the worlds of XMPP, Skype, AOL/AIM, IRC.

The goal of this article is not to commiserate over XMPP. It is to show you how SOA Suite can be configured to participate in XMPP based conversations – for now only as a sender of messages (we will discuss inbound integration with XMPP in a later article). In SOA Suite 12c, the functionality that was already available from the UMS (User Messaging Service) and the UMS Adapter in SOA Suite 11g has been continued and a little bit extended. I will show you what it looks like and how to make it to work.

Lees verder

Setup GMail as mail provider for SOA Suite 12c – configure SMTP certificate in trust store

On this subject, there are already many fine articles. I have borrowed from at least a dozen to understand what should happen and to make it work. You will find them listed under resources. I have collected wisdom from most of these and created a new description, that works for me and for SOA Suite 12c and will have you sending emails from the SOA Suite 12c through your GMail account in no time at all.

Lees verder

Resolving deployment issues with Service Bus 12c – OSB-398016 – Error loading WSDL

I was completely stuck with Service Bus 12c project deployment from JDeveloper to the Service Bus run time. Every deployment met with the same fate: Conflicts found during publish – OSB-398016, Error loading the WSDL from the repository:  The WSDL is not semantically valid: Failed to read wsdl file from url due to — java.net.MalformedURLException: Unknown protocol: servicebus.

I was completely lost and frustrated – not even a simple hello_world could make it to the server.

SNAGHTMLc3d51e6

Then, Google and Daniel Dias from Link Consulting to the rescue: http://middlewarebylink.wordpress.com/2014/07/17/soa-12c-end-to-end-e2e-tutorial-error-deploying-validatepayment/. He had run into the same problem – and he had a fix for it! Extremely hard to find if you ask me, but fairly easy to apply.

Lees verder