Sunday, September 30, 2012

Policy Attachments and Local Optimization in Composite-to-Composite Invocations in Oracle SOA Suite

Policy Attachments and Local Optimization in Composite-to-Composite Invocations in Oracle SOA Suite:

OWSM supports an Oracle SOA Suite local optimization feature for composite-to-composite invocations in which the reference of one composite specifies a web service binding to a second composite. Local optimization enables you to bypass the HTTP stack and SOAP/normalized message conversions during runtime. Local optimization is not used if the composites are in different containers. If a policy is attached to the web service binding, the policy may not be invoked if local optimization is used.

By default, an OWSM security policy includes a local-optimization property that identifies if the policy supports local optimization. You can view the setting for a policy in Oracle Enterprise Manager Fusion Middleware Control.
To view the local optimization setting for policies:
  • Login to EM console.
  • In the navigator, expand the WebLogic Domain folder.
  • Right-click on the Domain, and select Web Services > Policies.
  •  Select a policy and click Export to File.
  • Open the file with a text editor and search for local-optimization to identify the value. This property supports the following values:
    • on: Local optimization is used in the attached policy, and the policy is not applied at runtime. 
    • off: Local optimization is not used in the attached policy, and the policy is applied at runtime. 
    • check-identity: If a JAAS subject exists in the current thread, local optimization is used. Otherwise, local optimization is not used.
Local optimization is not used (the value for local-optimization is specified as off) for the policy oracle_wss_username_token_service_policy, the policy will be applied at runtime even though the Local Optimization is enabled.
  Local optimization is used (the value for local-optimization is specified as on) for the policy oracle_wss11_message_protection_service_policy, the policy will not be applied at runtime when the Local Optimization is enabled.




Wednesday, September 26, 2012

Overriding or Forcing Local Optimization in Oracle SOA Suite 11g

Overriding or Forcing Local Optimization in Oracle SOA Suite 11g:


Two configuration properties are provided for either overriding or forcing local optimization.

By default, Oracle SOA Suite prefers local optimization. However, you can override this behavior with the oracle.webservices.local.optimization binding property in the composite.xml file. When this property is set to false, local optimization is not performed and cross-composite calls are performed through SOAP and HTTP. 
You can override the oracle.webservices.local.optimization property and force optimization to be performed by setting the oracle.soa.local.optimization.force property to true. Use this property in the following scenarios:
  • The server configuration is sufficiently complicated (for example, there are fire wall or proxy settings in an intranet), which may cause the co-location checks to not deliver the correct result.
  • You clearly understand the semantics of local optimization, the system setup qualifies for local optimization, and local optimization is absolutely preferred.
If oracle.webservices.local.optimization is set to false and oracle.soa.local.optimization.force is set to false, local optimization is not performed.
 
The oracle.soa.local.optimization.force property has a default value of false. When this property is set to true, Oracle SOA Suite skips the condition checks.

Another important note about this property is that Oracle SOA Suite always honors the setting of this property (if policy checks allow the optimization). However, if local invocation fails due to non application faults or exceptions (that is, runtime errors mostly related to the direct Java invocation), the value of this setting is ignored for subsequent invocations on the configured endpoint and for all the valid endpoint addresses configured on the endpoint.

To enable the oracle.soa.local.optimization.force property:
Add oracle.soa.local.optimization.force as a binding component level property in the reference section of the composite being invoked. For example, if composite comp_comp2 invokes comp_comp1, then define this property in the reference section of the composite.xml file of comp_comp2.





Configuring Local Optimization in Oracle SOA Suite 11g

Configuring Local Optimization in Oracle SOA Suite 11g:


Local optimization is the process of one SOA composite application invoking another SOA composite application through direct Java invocations in an environment in which both composites are on the same SOA server (JVM).

Direct Java invocations are generally more efficient than SOAP over HTTP calls. Therefore, whenever the conditions are met for direct Java invocations, Oracle SOA Suite optimizes the service calls for the co-located composites.

In 10.1.x releases, we manually configured SOAP optimization with the optSoapShortcut property. For release 11g, SOAP optimization is automatically configured.

Condition Checks for Using Local Optimization:
Oracle SOA Suite performs the following condition checks to determine if local optimization is possible.
  • It must be a composite-to-composite invocation. This is the most fundamental criteria that makes the direct Java calls possible when both the client and target services are implemented based on the same SOA Infrastructure (that is, the same SOA server).
  • The composite implementing the reference (target) service must be active. This condition requires the target composite to be up and running, which in turn ensures that the reference service is available.
  • The client and target composites must be co-located on the same server. This is an obvious requirement for direct Java invocations. It is also a critical step in which Oracle SOA Suite compares the server (on which the client composite is deployed) host configuration with the host and port values specified in the reference (target) service endpoint URI. If the host and port values match, it can be concluded that the client and target composites are located on the same server.
  • However, the comparison is not necessarily straightforward given that working with both standalone and clustered server setups and potential load balancer configurations is necessary. Therefore, here are the step-by-step condition checks that determine the correct server configuration on all platforms:

    •  Checks the Server URL configuration property value on the SOA Infrastructure Common Properties in em console. 
    •  If not specified, checks the FrontendHost and FrontendHTTPPort (or FrontendHTTPSPort if SSL is enabled) properties configured for the cluster in the weblogic console.
    • If not specified, checks the FrontendHost and FrontendHTTPPort (or FrontendHTTPSPort if SSL is enabled) property configured for the Server in weblogic console.
Servers ->Specific Server - >Protocols ->HTTP

    • If not specified, uses the DNS-resolved Inet address of localhost.
    • Checks if the port value specified in the reference service endpoint URL matches the configured server port value. If no port value is specified in the endpoint URL, Oracle SOA Suite assumes 80 for HTTP and 443 for HTTPS URLs.
    • If the port values match, the server URL (that is, http(s)://host:port, where host and port are obtained from the checks mentioned above) is then compared to the server URL in the reference endpoint address. The URLs are resolved to canonical values and the comparison also takes into account the cases in which the endpoint URL host is localhost or 127.0.0.1.

    • Oracle SOA Suite concludes that the composites are co-located if the server URL comparison returns a value of true. 
If the comparison is passed in the above steps then the composite will be invoked locally via java else it will be invoked via HTTP. 
We can confirm if a call went over local optimization in the Trace section of the Flow Trace page. The (Local Invocation) text for the reference and service of the invoking and invoked composites is displayed 



Contact Form

Name

Email *

Message *