|
| Oracle B2B (SOA) Redirect Loop |
|
Problem statement: In Oracle SOA/B2B server, after authentication with weblogic ADMIN account, the browser Chrome/Firefox shows error 'This webpage has a redirect loop'. There is no loss/slowness of services or message flow due to this error.
Steps to fix this issue:
Take backup of config.xml before proceeding further,
a. Stop all the Servers including Adminserver
b. Do the below modifications,
Your config.xml will have an entry like below,
<app-deployment>
<name>b2bui</name>
<target>soa_cluster</target>
<module-type>ear</module-type>
<source-path>/u01/middleware/11g/Oracle_SOA1/soa/applications/soa-infra-b2bui-wls.ear</source-path>
<deployment-order>313</deployment-order>
<security-dd-model>DDOnly</security-dd-model>
<staging-mode>nostage</staging-mode>
</app-deployment>
Modify it to,
<app-deployment>
<name>b2bui</name>
<target>soa_cluster</target>
<module-type>ear</module-type>
<source-path>/u01/middleware/11g/Oracle_SOA1/soa/applications/soa-infra-b2bui-wls.ear</source-path>
<sub-deployment>
<name>/b2bconsole</name>
<target>soa_cluster</target>
</sub-deployment>
<deployment-order>313</deployment-order>
<security-dd-model>DDOnly</security-dd-model>
<staging-mode>nostage</staging-mode>
</app-deployment>
c. Restart the Entire Domain. Then access the B2B Console URL.
Cheers.
|
 |
|
|
|
| SOA Suite - Using a common XQuery Function Library (Transformation/Mapping) |
|
When you write an XQuery for instance you have a lot of power in your hands by using complex FLOWR expressions, but usually the most common mappings include checking an element for existence and performing an if/else construction.
Since this needed to be done in more than just one transformation you can have your time invested in creating common XQuery functions.
But before you invest in creating your own library take a look into the library made by xqueryfunctions.com (FunctX). It contains a lot of function that can help you in your daily work. Just put the library, which you can download here, into a shared repository like the MDS and import it as a library into your existing XQuery transformation.
The FunctX library consists of 151 extra functions besides the 111 built-in XQuery functions. These functions are sorted in 10 different catagories like Strings, Numbers, Atomic Values of All Types, Sequences, XML Elements & Attributes and even a category for XML Namespaces. The most functions I use are for checking missing values, Trimming and Padding and Constructing and Converting dates.
|
 |
|
|
|
| Oracle Service Bus 11g, Using Custom Xpath Functions |
|
In the new Oracle Service Bus 11g, Oracle gives us new functionality for the use of custom xpath functions. These functions we eventually can re-use in for example the xslt or xquery transformations.
For this we need :
1. XML Configuration file (osb-custom.xml)
2. Property file (optional, osb-custom.properties)
3. Custom Function Class (jar package)
All these files need to be stored at the following location: <OSB_HOME>/config/xpath-functions
1. XML CONFIGURATION FILE
Create a new XML configuration file. I made a copy of the default file, osb-built-in.xml, edit that one, and change the settings.
2. PROPERTY FILE
%OSB_FUNCTIONS%=Service Bus Functions
%FUNC_CUSTOM_CONCAT_COMMENT%=Returns the concat of the first and the second parameter
Not much in here,just a few placeholders for the descriptions.
3. CUSTOM FUNCTION CLASS
Create a new Java project in your favorite IDE. Create a new package and java class.
The method needs to be defined as static.
Compile the code and create a jar archive and store this at the location mentioned in the top of the article. After this we should have 3 extra files in this directory :
osb-custom.xml
osb-custom.properties
osb-custom.jar
Restart the server, so the Oracle Service Bus will load the custom classes we just created. Check the output of the console to see if don’t see any errors come by. Wrong configuration (wrong methodname,package, etc) will end up with a little stacktrace in here.
TESTING
To test the custom xpath function, create a new Oracle Service Bus project in Eclipse. Add new XQuery Transformation. In the list of expression functions we will see our custom function. Create a proxy and assign operation to make use of this expression function and test it.
Labels: integration, jar as xslt in osb, java callout alternative in osb, oracle service bus throttling, osb, soa, using java in osb |
 |
|
|
|
| Throttling in Oracle Service Bus (OSB) |
|
A common problem with integration is the risk of overloading a particular web service. When the capacity of a web service is reached and it continues to accept connections, it will most likely start to deteriorate.
Fortunately there are 2 techniques, with Oracle Service Bus, that you can apply for protecting this from happening. You can either limit the concurrent number of requests for a Business Service (outbound requests) or you can limit the number of threads processing the requests for a Proxy Service (inbound requests).
Limiting the Concurrent Number of Requests
Limiting the concurrent requests for a Business Service cannot be set at design time so you have to use the built-in Oracle Service Bus Administration Console to do it (/sbconsole). Follow these steps to enable it:
- In Change Center, click Create to start a new Session
- Select Project Explorer, and navigate to the Business Service you want to limit
- Select the Operational Settings tab of the View a Business Service page
- In this tab, under Throttling, select the Enable check box. By enabling throttling you
- Specify a value for Maximum Concurrency
- Specify a positive integer value for Throttling Queue to backlog messages that has exceeded the message concurrency limit
- Specify the maximum time in milliseconds for Message Expiration a message can spend in Throttling Queue
- Click Update
- Click Active in Change Center to active the new settings
If you re-publish the service, it will not overwrite the settings. Only if the resource is renamed or moved, it will.
Please note that a throttling queue is an in-memory queue. Messages that are placed in this queue are not recoverable when a server fails or when you restart a server.
Limiting the Number of Threads
A better approach, in my opinion, is to limit the number of threads that can work with request. Follow these steps to do it:
> Open the WebLogic Server Console (/console)
> In Change Center, click Create to start a new Session
> In the left pane expand Environment and select Work Managers
> In the Global Work Managers page, click New
> Click the Work Manager radio button, then click Next
> Enter a Name for the new Work Manager, and click Next
> In the Available Targets list, select server instances or clusters on which you will deploy applications that reference the Work Manager
> Click Finish.
The new Work Manager now appears in the Global Work Managers page.
> Select the new Work Manager
> Right next to the Maximum Threads Constraint drop-down box, click New
> Click the Maximum Threads Constraint radio button, then click Next
> Enter a Name and a thread Count to be the maximum size to allocate for requests. Click Next
> In the Available Targets list, select server instances or clusters on which you will deploy applications that reference the Work Manage
> Click Finish
> Click Save
> Click Active in Change Center to active your changes. A restart may be necessary.
Puh! Almost there.
> Start a new session. Go to the Service Bus Console (/sbconsole) and find your consuming Proxy Service.
> Click the Edit button of the Transport Configuration tab.
> Click Next
> Set the Dispatch Policy to the new Work Manager
> Click Last
> Click Save
> Click Active in Change Center to active your changes.
Looking for more details?
Visit - Configuring Business Services for Message Throttling
Recommended:
Defining work managers with max and min thread constraing ensures that there is no deadlock and threads are always available to process the response from the called services.
You need to assign work managers to osb proxy services(max thread constraint) that use service callout and the osb business services(min thread constraint) that are called using the service callout
The values need to be set as per your requirements and environment.
For some services, the load might be less and some it maybe more. For some services, there might be burst of messages within a short period of time and for other services there might be regular uniform flow of messages.
So, I cannot recommend any values and you would be the best judge of that considering various factors like concurrency, peak load, average load, resources like CPU/Memory, number of managed servers available etc.
I can only suggest like you can start with a low number e.g 10 or 15 threads for max constraint and 2-5 for min constraint for each work manager and then modify them as per your tests and observations etc. Also, the the proxy and business services should not be using the same work manager. There are some known issues related to it (Oracle document: Doc ID 1376993.1)
Labels: configure throttling in osb, fusion throttling, integration, oracle service bus throttling, osb, overload protection, performance tuning in osb, soa, throttling |
 |
|
|
|
| Oracle Weblogic Server Important Files Name, Locations and their Purpose |
|
PATH For Admin Server
|
Purpose
|
Important Files Present
|
$DomainHome/$serverName/bin
|
Contains all the shell script files which is being used to start/stop and contains configuration for Admin and Managed servers.
|
setDomainEnv.sh startWebLogic.sh stopWebLogic.sh
|
$DomainHome/$serverName/config
|
Contains configuration files all important components e.g. Domain configurtaion, JMS, JDBC etc
|
config.xml jdbc config files jms config files fmwconfig files etc
|
$DomainHome/$serverName/osb/config
|
This directory mainly contains all the OSB artifats e.g. Proxy Services, business Services, XSD, Xquery etc, whatever we do from OSB console, most of stuff get store here only.
|
All the OSB artifacts
|
$DomainHome/$serverName/osb/config/core/_static/Ref_Store
|
This folder contains files having reference to OSB proxy and business services which are tagged with JMS as consumer. This directory helps during cleanup process of OSB deployment. There could be multiple OSB services get tagged with queue which could cause issues, this directory contents will help to clean that.
|
.str files for JMS MDB artifacts
|
$DomainHome/$serverName/sbgen
|
This folder contains MDBs for JMS queues, which could be used for any OSB Proxy service or JAVA application.
|
ear files e.g. _ALSB_1341965872872.ear
|
$DomainHome/$serverName/sbgen/alsbTempJars
|
This folder contains the .jar files which Proxy services are using via JAVA Callout action.
|
jar files e.g. tempCreateProcess8557633063030887848.jar
|
$DomainHome/$serverName/servers/$serverName/adr
|
Contains all diagnostic related data, if you have configured the Weblogic Diagnostic Framework e.g. In the event of server crash a report get generated etc, in this case a thread dumps file will generated here, also contains JMS, Datasource stats etc, good for investigation purpose.
|
jvm_threads.txt, dms_metrics.txt
|
$DomainHome/$serverName/servers/$serverName/data/store
|
This directory contains the persistent file store for weblogic servers which is used for normal functionality and diagnostic functionality. Weblogic has 7 internal components e.g. JMS Messages, JTA logs, EJB Timer services, Diagnostic services etc. which uses these persistent file store.
|
_WLS_$serverName000000.DAT _WLS_DIAGNOSTICS000000.DAT
|
$DomainHome/$serverName/servers/$serverName/data/ldap
|
Contains LDAP related files, contains security realm details etc. If you delete this folder, you will lose all security realm users details exist in Weblogic Admin console.
|
EmbeddedLDAP.data changelog.data changelog.index etc
|
$DomainHome/$serverName/servers/$serverName/data/console
|
Store the Admin console preference.
|
ConsolePreferences.xml
|
$DomainHome/$serverName/servers/$serverName/security
|
This file contains encrypted weblogic username and password, used while starting the server.
|
boot.properties
|
$DomainHome/$serverName/servers/$serverName/tmp
|
This folder contains all the artifacts which is been deployed in servers, alternatively can be seen from "deployment" section from Weblogic Admin Server console, included JMS MDB artifacts as well.
|
All the Library like this adf.oracle.businesseditor adf.oracle.domain etc ALSB Logging ALSB Publish em File Transport Provider components etc
|
$DomainHome/$serverName/servers/stage
|
This is stagging directory, during server startup process, JMS MDB, J2EE, War application get copied from Admin server to Managed server at this stage directory and then Managed server refer to local stage directory for deployment and things moved from Stage to 'tmp' directory. Note: for admin server you will not see this directory.
|
_ALSB_1352464196062 etc
|
$DomainHome/$serverName/servers/$serverName/logs
|
Contains all the logs files for troubleshooting purpose.
|
access.log, AdminServer.log ManagedServer.log gc.log domain.log AdminServer.out ManagedServer.out files
|
$DomainHome/$serverName/servers/sysman/log
|
Contains Management Service logs and trace file for troubleshooting purpose.
|
emoms.log emoms.trc
|
$DomainHome/$serverName/servers/cache
|
Contains all the cached information weblogic uses directory to store cache for various components e.g. web tire related cache, JMS cache, data sources, EJB cache etc.
|
.class files
|
|
 |
|
|
|
| Performance Tunning OSB - Proxy, Business Service, Logs, XQuery |
|
1. Avoid creating many OSB context variables that are used just once within another XQuery: Context variables created using an Assign action are converted to XmlBeans and then reverted to the native XQuery format for the next XQuery. Multiple "Assign" actions can be collapsed into a single Assign action using a FLWOR expression. Intermediate values can be created using "let" statements. Avoiding redundant context variable creation eliminates overheads associated with internal data format conversions. This benefit has to be balanced against visibility of the code and reuse of the variables.
2. Transforming contents of a context variable such as $body: Use a Replace action to complete the transformation in a single step. If the entire content of $body is to be replaced, leave the XPath field blank and select "Replace node contents". This is faster than pointing to the child node of $body (e.g. $body/Order) and selecting "Replace entire node". Leaving the XPath field blank eliminates an extra XQuery evaluation.
3. Use $body/*[1] to represent the contents of $body as an input to a Transformation (XQuery / XSLT) resource: OSB treats "$body/*[1]" as a special XPath that can be evaluated without invoking the XQuery engine. This is faster than specifying an absolute path pointing to the child of $body. A general XPath like "$body/Order" must be evaluated by the XQuery engine before the primary transformation resource is executed.
4. Enable Streaming for pure Content-Based Routing scenarios: Read-only scenarios such as Content-Based Routing can derive better performance from enabling streaming. OSB leverages the partial parsing capabilities of the XQuery engine when streaming is used in conjunction with indexed XPaths. Thus,
the payload is parsed and processed only to the field referred to in the XPath.Other than partial parsing, an additional benefit for read-only scenarios is that streaming eliminates the overhead associated with parsing and serialization of XmlBeans. The gains from streaming can be negated if the payload is accessed a large number of times for reading multiple fields. If all fields read are located in a single subsection of the XML document, a hybrid approach provides the best performance. The output of a transformation is stored in a compressed buffer format either in memory or on disk. Therefore, streaming should be avoided when running out of memory is not a concern.
5. Set the appropriate QOS level and transaction settings: Do not set XA or Exactly-Once unless the reliability level required is once and only once and its possible to use the setting (it is not possible if the client is a HTTP client). If OSB initiates a transaction, it is possible to replace XA with LLR to achieve the same level of reliability. OSB can invoke a back end HTTP service asynchronously if the QOS is "Best-Effort". Asynchronous invocation allows OSB to scale better with long running back-end services. It also allows Publish over HTTP to be truly fire-and-forget.
6. Disable or delete all log actions: Log actions add an I/O overhead. Logging also involves an XQuery evaluation which can be expensive. Writing to a single device (resource or directory) can also result in lock contentions
7. Avoid the use of double front slashes ("//") in XPaths: $body//CustName while returning the same value as $body/Order/CtrlArea/CustName will perform a lot worse than the latter expression. "//" implies all occurrences of a node irrespective of the location in an XML tree. Thus, the entire depth and breadth of the XML tree has to be searched for the pattern specified after a "//". Use "//" only if the exact location of a node is not known at design time.
8. Index XPaths where applicable: An XPath can be indexed by simply adding "[1]" after each node of the path. XQuery is a declarative language and an XPath can return more than one node; it can return an array of nodes. $body/Order/CtrlArea/CustName implies returning all instances Order under $body and all instances of CtrlArea under Order. Therefore, the entire document has to be read in order to correctly process the above XPath. If you know that there is a single instance of Order under $body and a single instance of CtrlArea under Order, we could rewrite the above XPath as $body/Order[1]/CtrlArea[1]/CustName[1].
The second XPath implies returning the first instances of the child nodes. Thus, only the top part of the document needs to be processed by the XQuery engine resulting in better performance. Indexing is key to processing only what is needed.
9. Extract frequently used parts of a large XML document as intermediate variables
within a FLWOR expression: An intermediate variable can be used to store the common context for multiple values. Sample XPaths with common context:
$body/Order[1]/Summary[1]/Total, $body/Order[1]/Summary[1]/Status,
$body/Order[1]/Summary[1]/Shipping
The above XPaths can be changed to use an intermediate variable:
let $summary := $body/Order[1]/Summary[1]
$summary/Total, $ summary/Status, $summary/Shipping
Using intermediate variables consumes more memory but reduces redundant XPath processing.
|
 |
|
|
|
| OracleFusionMentor 's TIP of the month! How do I get a list of disabled services? |
|
When you’re dealing with numerous web services in your environment, it becomes impractical
to examine individual services manually to see whether they are enabled. Fortunately,
the Smart Search feature in the OSB console makes finding disabled services a breeze.
You can access the Smart Search feature from the Operations section of the Dashboard:
|
 |
|
|
|
|
| Manesh Abhimanyu |
Manesh is a Senior Enterprise Appln. Integration Consultant, at present working in Singapore (Little Red Dot).
His focus is in the areas of SOA, ESB and Enterprise Architecture Management.
Contact him via email (mak2powerATyahoo.co.in)
|
| Menu |
|
| Archives |
|
|
| Links |
|
|
| Website developed & maintained by |
Manesh
Abhimanyu K. (Mak)
Click here to contact Manesh
|
|