Friday, June 13, 2014

Off-line SOA Suite configuration

Configuration of Oracle SOA Suite 11g is based on runtime interaction with MBeans. Document describes how to configure SOA Suite in off-line mode using EAR application archive and standard Oracle MDS libraries. 
Rationale
Oracle SOA Suite 11g package is shipped with plenty of software components. Some of them may be not required and should be disabled to minimize level of resource consumption. One good reason is to just save energy, CPU cycles, memory, and system boot time. Another good one is to minimize risk of system failure due to unexpected system behavior.

Oracle SOA Suite 11g is highly configurable, but vast majority of system tuning is done in on-line mode via MBeans. Oracle ships WLST libraries to script the tuning, but execution of WLST requires operating in on-line mode as well. What is not perfect, and against typical enterprise deployment style - it's not possible to specify configuration options in classic, file based, off-line, WebLogic style. Classic WebLogic, config.xml based, approach is a good example of fulfilling this enterprise level principle.

Interesting is that such possibility was available in initial release of SOA Suite 11g, but starting from, most probably, release 11.1.1.2 the configuration is based on MDS (Fusion Middleware repository for application data).

By the book system configuration
By the book configuration of SOA installation with desired system configuration, consists of 5 steps including two system starts. Moreover configuration  steps requires use of system password to access MBeans in both manual and scripted way. This requirement makes enterprise deployment difficult as sensitive password must be shared with operator or must me stored in filesystem to be available for the script.

Enterprise ready system configuration
Engineered configuration eliminates two non enterprise pains of by the book SOA configuration: (1) configuration time system start, and (2) sharing admin account password. 
The target configuration flow is flawlessly executed during startup of a new system, for a price of additional pre-configuration work done by system engineer during configuration phase. This steps consist of (1) preparation of SOA configuration files, and (2) building EAR file with embedded SOA configuration. 
Configuration files are be stored in project's source repository, and EAR preparation script is executed by system build script.

Finally both build and deployment processes are fully automated, free of non required system starts, does not require sharing password, and fits into enterprise application lifecycle.

The solution
Solution is based on three facts: (1) SOA uses MDS to store configuration, (2) SOA uses MAR file to initially populate MDS, and (3) automated MAR deployment is standard element of ADF framework. Knowing that, it's possible to configure SOA, deploying minimalistic ADF style application which triggers MAR content copy to MDS. 
Build of EAR archive is provided in a form of bash script fed by template data, configuration files and number of parameters. Configuration files may be prepared manually, or exported from existing SOA Suite's MDS.

Generating EAR with SOA configuration 
EAR file generation is provided by a bash script, parameterized by (1) version of the configuration set, (2) filter for configuration files selection, (3) directory with configuration files, (4) directory with ADF EAR elements, (5) destination for EAR file, (6) log file, (7) temp directory, and (8) list of variables to be substituted in configuration files.

For example:
./prepareSOACONFIGdeployment.sh 1v0 "b2b|edn|mediator|soa-infra" $BUILD/SOAcfg/ear $BUILD/SOAcfg /app/app01/sca /tmp/soaconfig.log /tmp CFG_AUTODEPLOY=/app/app01/sca

will read files from $BUILD/SOAcfg filtered by b2b|edn|mediator|soa-infra (b2b or edn or …) and save in EAR archive with 1v0 added to the file name. Source files (EAR JEE meta information) will be taken from $BUILD/SOAcfg/ear directory. Variable "CFG_AUTODEPLOY" will be substituted with provided value in all configuration files, and subset of files from EAR template directory. 

Script creates ready to deploy EAR file. For information about internals of this EAR look into document JEE application and MDS provisioning.

Variable substitution
Script handles variable substitution. Source configuration files may be prepared with sections to be replaced with desired values during EAR build time. Parametrized section is defined using ${VARIABLE_NAME} pattern, and supplied as script's parameter.

Take a look at below example, where SOA infra configuration file is prepared to define two elements: (1) EDN JMS mode, and (2) auto deploy directory.

<?xml version='1.0' encoding='UTF-8'?>
(…)
<ns3:ednJmsMode>${CFG_EDNJMSMODE}</ns3:ednJmsMode>
<ns3:autodeployDir>${CFG_AUTODEPLOY}</ns3:autodeployDir>
(…)
</ns3:soa-infra-config>

Elements' values are specified as EAR build parameter. Multiple variables are delimited by space. Quotation mark is used to keep list of variable as one parameter of the script.

./prepareSOACONFIGdeployment.sh 1v0 "b2b|edn|mediator|soa-infra" $BUILD/SOAcfg/ear $BUILD/SOAcfg /app/app01/sca /tmp/soaconfig.log /tmp "CFG_AUTODEPLOY=/app/app01/sca CFG_EDNJMSMODE=false"

Note that, inside of the script, shell's environment is used to carry variables values, thus any variable defined by EXPORT will be picked up by substitution logic.

Verification of variable substitution
Variable substitution is verified by a script for each set of files. In case of variables without provided values, the build is stopped with error and signaled by exit code.

./prepareSOACONFIGdeployment.sh 1v0 "b2b|edn|mediator|soa-infra" ./cfg ./src ./deploy /home/oracle/SOACONFIG1v2d1/soaconfig.log /tmp CFG_AUTODEPLOY=/app/app01/sca
echo "Exit code: $?"

Removing not empty soa-config build directory....Done.
Creating soa-config build directory..............Done.
Creating mds build directory.....................Done.
Creating war build directory.....................Done.
Creating ear build directory.....................Done.
Checking source configuration files..............Done.
Processing variable substitution
|---Processing file: ./cfg/b2b-config.xml
|   |--- (no variables)
|---Processing file: ./cfg/edn-config.xml
|   |--- (no variables)
|---Processing file: ./cfg/mediator-config.xml
|   |--- (no variables)
|---Processing file: ./cfg/soa-infra-config.xml
|   |--- CFG_EDNJMSMODE
|   |--- CFG_AUTODEPLOY
\---Verifying that all variables were replaced...Error.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Error running: \---Verifying that all variables were replaced. Exiting.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


Exit code: 20

Registration in config.xml
Generated Deployable MAR files can be registered in WLS domain by (1) interactive deployment trough console, or by (2) adding descriptors to config.xml. Note that both files must be deployed with deployment order lower than 350 used by soa-infra-wls.ear.

  <app-deployment>
    <name>soa-config</name>
    <target>SOAcluster</target>
    <module-type>ear</module-type>
    <source-path>config/soa-config_1.0.ear</source-path>
    <deployment-order>340</deployment-order>
    <security-dd-model>DDOnly</security-dd-model>
    <staging-mode>nostage</staging-mode>
  </app-deployment>

Done
You are done. Now after start of the domain, soa-config application will be deployed, and MAR will be transferred to MDS. SOA Suite during it's first start will realize that configuration files are in the MDS, and will not overwrite them, but use instead.

Appendixes

Exporting configuration files from MDS
Configuration files preparation must be done on a staging system. The SOA stack may be configured properly before MDS export, what will simplify further steps. The export may be done by EM user interface or WLST. EM flow may be convenient to be used just after manual configuration. Enterprise Manager exposes MDS export in soa-infra administration menu.
Figure. MDS Configuration entry menu

Figure. MDS export screen


After the export, configuration files should be prepared for potential build time adjustment, by defining variables, and added to configuration management repository. During the build process, when EAR generation script is started, the files must be available in a file system.

Note that MDS export contains all information stored in the repository. You need to copy only required files used in tuning process. Note that SOA will write missing files to the MDS.

Figure. File soa.mar generated be MDS export

Analysis
At beginning it was confirmed that Oracle RCU utility does not populate MDS schema with data, creating only raw database schema. In the next step, introspection of soa-infra-wls.ear (SOA Suite main component) uncovered soa.mar file - MDS export file. Inside of soa.mar we found all files as known form JDeveloper view on SOA Suite MDS, including whole set of *-config.xml, known from initial release of 11g. Additional analysis made it clear that SOA Suite uses standard MDS population method exposed by ADF Customization API as described here: [OTN1], and here [DevADF11g5].

Limitations & risks
Described method is useful only in off-line mode. Deployment of config module will populate MDS with content of provided MAR, but SOA components will be not notified about the change. Cluster deployment is supported by this technique - Oracle MDS core logic guarantees that only one node will perform MAR to MDS transfer. In case of manual configuration change, system restart will redeploy original files.

Compatibility with SOA Suite
By design, deployment of SOA Suite's main component soa-infra-wls.ear populates MDS with data from soa.mar. SOA Suite engineers changed default behavior of MAR deployment by adding protection agains overwriting already existing configuration files. The extension, coded in oracle.soa.mar.SOATransferListener (configured using edn-config.xsd), extending oracle.mds.transfer.TransferListener, guarantees that only non-existing configuration files will be transferred to MDS.

In the log file you may see following information:
<Notice> <StdErr> <BEA-000000> <INFO: /soa/configuration default/b2b-config.xml already exists in target store> 
<Notice> <StdErr> <BEA-000000> <INFO: /soa/configuration default/mediator-config.xml doesn't exists in target store> 

The former means that b2b-config.xml exists in MDS and will be not overwritten, and the latter one shows that mediator-config will be copied to MDS. This mechanism makes it possible to deploy MAR with configuration before soa-infra-wls.ear. Engineered SOA configuration approach is fully compatible with SOA Suite 11g.

References


Appendices

prepareSOACONFIGdeployment.sh
The script requires unzipped ADF like ear file in ./cfg directory.

#!/bin/bash

#Changelog
#1.2 fixed: substitution result was not validated for other files than "cfg". now is moved to substitute function
#    fixed: CFG_VERSION and other internal variables were not eported.
#    improved indention of processed files.  
#    added new parameter with variables/values

#Change condidate log
#1.3 spelling: Procesing->Processing
#    spelling, anonimization: Usage section
#    fixed: fixed issue when more than one variable is defined in single file 

#Parameters
#Note that parameters must be exported to be available in child processes e.g. perl is used to variable substitution

#export CFG_VERSION=1.0      # configuration version to be added to ear name
#export CFG_AUTODEPLOY=../   # autodeploy directory dependent on environment
#export CFG_FILTER="b2b|edn|mediator|soa-infra" # filter to select cfg. files 
#export CFG_FILES=./cfg      # directory with configuration files (svn fetch) 
#export CFG_SRC=./src        # directory with EAR src files (svn fetch)
#export CFG_DEPLOY=./deploy  # place to write generated EAR file
#export LOG_FILE=~/SOACONFIG/$0.log    # log file to write output from this script
#export tmpDir=/tmp          # temp dir to build ear

function usage {
cat <<EOF
Deployable, MDS based SOA Suite 11g configuration ryszard.styczynski@oracle.com, May 2014, version 1.2
Usage:

./prepareSOACONFIGdeployment.sh CFG_VERSION CFG_FILTER CFG_FILES CFG_SRC LOG_FILE tmpDir listOfVariables 

Note that: 
1. LOG_FILE and tmpDir must be absolute paths
2. configuration files use variables that must match with or with listOfVariables e.g.:   

./prepareSOACONFIGdeployment.sh CFG_VERSION CFG_FILTER CFG_FILES CFG_SRC LOG_FILE tmpDir CFG_AUTODEPLOY=/app/app01/sca

cat cfg/soa-infra-config.xml | grep autodeployDir 
<ns3:autodeployDir>${CFG_AUTODEPLOY}</ns3:autodeployDir> 

will produce: <ns3:autodeployDir>/app/app01/sca</ns3:autodeployDir>

Script checks if all variables were replaced. If not exits with code > 0.

Exemplary use:
./prepareSOACONFIGdeployment.sh 1v0 "b2b|edn|mediator|soa-infra" ./cfg ./src ./deploy $PWD/soaconfig.log /tmp CFG_AUTODEPLOY=/app/app01/sca

generates EAR file and writes to ./deploy/soa-config-1v0.ear 
EOF
}

#utility functions
dotsDots='.............................................................................................................................................'
dotsLines='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ '
dotsDash='----------------------------------------------------------------------------------------------------------------------------------------------'
dotsSpaces='                                                                                                                                          '
function echoTab {
 if [ -z "$3" ]; then
  dots=$dotsDots
 else
  dots="$3"
 fi
 if [ -z "$2" ]; then 
   if [ -z "$tabultor" ]; then
        tabPos=60
   else
    tabPos=$tabulator
   fi
 else
   tabPos=$2
 fi
 filldots=$(( $tabPos - $(echo $1 | wc -c) ))
 if [ $filldots -lt 0 ]; then
        filldots=1
 fi
 echo -n "$1$(echo "$dots" | cut -b1-$filldots )" | tee -a $LOG_FILE
}

function logDate {
        dateStr=$(date)
        echo $@
        echo $dateStr, $@ >>$LOG_FILE
}

function log {
        if [ "$1" == "-n" ]; then
                shift
                echo -n "$@"
                echo "$@" >>$LOG_FILE
        else
                echo "$@" | tee -a $LOG_FILE
        fi
}

function execOrDie {
        stepMsg=$1; shift
        exitCode=$1; shift
        runCMD=$1; shift

        echoTab "$stepMsg" 50
        $runCMD $@ >>$LOG_FILE
        if [ $? -ne 0 ]; then
                log Error.
                logDate "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
                logDate "Error running: $stepMsg. Exiting."
                logDate "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
                exit $exitCode
        else
removeTmpFiles 
                log Done.
                return 0
        fi
}

function reverseExitCode {
        $@
        if [ $? -eq 0 ]; then
                return 255
        else
                return 0
        fi
}

function removeTmpFiles {
 rm -rf CFG_BUILD
}

function substituteVariablesInFiles {
        cfgFiles=$1
        outDir=$2

log "Processing variable substitution"
        for file in $cfgFiles; do
         log "|---Processing file: $file"
         variables=$(cat $file | perl -ne 'if (/\${(\w+)}/) { print "$1\n";}')
         if [ ! -z "$variables" ]; then
for variable in $variables; do
                 log "|   |--- $variable"
done
         else
            log "|   |--- (no variables)"
         fi
         cat $file | perl -p -e 's/\$\{(\w+)\}/(exists $ENV{$1}?$ENV{$1}:"\${$1}")/eg' > $outDir/$(basename $file)
        done
execOrDie "\---Verifying that all variables were replaced" 20 reverseExitCode egrep '\$\{\w+\}' $outDir/*
}

#STEP 0. Check if required utilities are available
#zip date tee egrep perl sed
#TODO

#STEP 1. Validate parameters and expected directories

#STEP 1.1 Check number of parameters and assign provided values

if [ $# -ne 8 ]; then
usage
exit 10
fi

#required by variable subsitution
export CFG_VERSION=$1
export CFG_FILTER=$2
export CFG_FILES=$3
export CFG_SRC=$4
export CFG_DEPLOY=$5
export LOG_FILE=$6
export tmpDir=$7
varList=$8

#STEP 1.2 Prepare parameters and directories

#decode variables provided as scrip tparameter no.8
#Note that parameters must be exported to be available in child processes
for varSnippet in $varList; do
eval "export $varSnippet"
done

CFG_BUILD=$tmpDir/soa-config-$CFG_VERSION
if [ -d $CFG_BUILD ]; then
        cd $tmpDir
        execOrDie "Removing not empty soa-config build directory" 11 rm -rf soa-config-$CFG_VERSION
        cd - >/dev/null
fi
execOrDie "Creating soa-config build directory" 10 mkdir -p $CFG_BUILD

MDS_BUILD=$CFG_BUILD/mds
if [ -d $MDS_BUILD ]; then
        cd $CFG_BUILD
        execOrDie "Removing not empty mds build directory" 10 rm -rf mds
        cd - >/dev/null
fi
execOrDie "Creating mds build directory" 10 mkdir -p $MDS_BUILD/soa/configuration/default

WAR_BUILD=$CFG_BUILD/war
if [ -d $WAR_BUILD ]; then
        cd $CFG_BUILD
        execOrDie "Removing not empty war build directory" 10 rm -rf war
        cd - >/dev/null
fi
execOrDie "Creating war build directory" 10 mkdir -p $WAR_BUILD

EAR_BUILD=$CFG_BUILD/ear
if [ -d $EAR_BUILD ]; then
        cd $CFG_BUILD
        execOrDie "Removing not empty war build directory" 10 rm -rf ear
        cd - >/dev/null
fi
execOrDie "Creating ear build directory" 10 mkdir -p $EAR_BUILD


#STEP 2.1. Copy cfg files updating autodeployDir in soa-infra-config.xml
execOrDie "Checking source configuration files" 20 ls $CFG_FILES/*
cfgFiles=$(ls $CFG_FILES/* | egrep $CFG_FILTER)
writeToDir=$MDS_BUILD/soa/configuration/default
substituteVariablesInFiles "$cfgFiles" $writeToDir

#STEP 2.2. 
execOrDie "Verifying that files were generated" 20 ls $MDS_BUILD/soa/configuration/default/*.xml

#STEP 2.4. Build soa-config.mar
cd  $MDS_BUILD
execOrDie "Building soa-config.mar file" 20 zip -r $CFG_BUILD/ear/soa-config.mar .
cd - >/dev/null

#STEP 3. Prepare elements of EAR

#STEP 3.1 Build adf-loc.jar
execOrDie "Create EAR/lib directory" 30 mkdir $EAR_BUILD/lib
cd $CFG_SRC/lib
execOrDie "Create adf-loc.jar file." 30 zip $EAR_BUILD/lib/adf-loc.jar META-INF/MANIFEST.MF
cd - >/dev/null

#STEP 3.2 Build adf/META-INF/adf-config.xml
execOrDie "Creating directory for adf-config.xml" 30 mkdir -p $EAR_BUILD/adf/META-INF
execOrDie "Checking source ADF configuration files" 30 ls $CFG_SRC/adf/META-INF/*
adfFiles=$(ls $CFG_SRC/adf/META-INF/*)
writeToDir=$EAR_BUILD/adf/META-INF
substituteVariablesInFiles "$adfFiles" $writeToDir

#STEP 3.3
execOrDie "Checking destination ADF configuration files" 30 ls $writeToDir

#STEP 3.4 Copy application.xml updating context-root with version number
execOrDie "Creating directory for EAR cfg. files" 30 mkdir -p $EAR_BUILD/META-INF
execOrDie "Checking EAR configuration files" 30 ls $CFG_SRC/META-INF/*
earFiles=$(ls $CFG_SRC/META-INF/*)
writeToDir=$EAR_BUILD/META-INF
substituteVariablesInFiles "$earFiles" $writeToDir
execOrDie "Checking destination EAR desriptors" 30 ls $writeToDir

#STEP 4.1. Generate index.html
cfgFiles=$(ls $MDS_BUILD/soa/configuration/default)
for file in $cfgFiles; do
        echo "<h1>$file</h1>" >>$WAR_BUILD/index.html
        cat $MDS_BUILD/soa/configuration/default/$file | sed 's/</\&lt;/g' | sed 's/>/\&gt;/g' | sed 's#$#</br>\n#g' >>$WAR_BUILD/index.html
done

#STEP 4.2. Build soa-config.war
cd  $WAR_BUILD
execOrDie "Building soa-config.war" 20 zip -r $CFG_BUILD/ear/soa-config.war .
cd - >/dev/null

#STEP 5. Build soa-config-$CFG_VERSION.ear
cd $CFG_BUILD/ear
execOrDie "Building EAR file" 50 zip -r $CFG_BUILD/soa-config-$CFG_VERSION.tmp *
cd - >/dev/null

#STEP 6. Move to deployment directory
execOrDie "Moving EAR to deployment directory" 60 mv $CFG_BUILD/soa-config-$CFG_VERSION.tmp $CFG_DEPLOY/soa-config-$CFG_VERSION.ear
removeTmpFiles 
echo Done.

Complete dump of SOACONFIG
Copy/paste below command to create directory with all required files. Content was prepared by: "tar c SOACONFIG | gzip | base64". Source files are published on github: https://github.com/rstyczynski/tools.


echo "H4sIACnsmlMAA+19/XfbNrKo07vvvC3fL/vTO+9HrKJ7k/RVpD7tPFdWI1tyq65lu5bS7N5Njx9FQjYTimRJyrba5p7+6XcGAL+pjySOmm04Pj6UgMFgMBgMBgMQGp11j85OjwffKDsfDKrV6l6rRdhzlz+r9SZ/CiC1eqO529qtNhpNUq01a63GDml9OJYimHu+6gIrrucvtJ8XlvfayMUDtOl0BR3RjvD5LwKjsP/lS7k3uhz5tkvvuQ6Qx26zubz/a3ux/m/Wof93q63qDqneMx+58In3/87/+N//c+eznZ2hqpGzEfk7EYBpO5/Dfx3+j+Efv99hgRDjL8tIdsfjC/HxLihVwMcJsfH/gUb/uvFfa1arzdT4b+02msX43xI8OJzrtR02nP+8w587/56HB///tuPtuDua7mnmxLbNMO+zGM4DpJHKL6CAAgoooIACPj54wB9//l+/LxsFFFDARwhoH4h4PhPP3/jzgcj/TDz/FCvzF/Ek4vlMPH/jzwcC7zPx/JN4/lk8/yKeRDyfiedv/CmM1gOx+Hggan7wZ/EUAYoHRDyfvVWTCyjgk4F/44+/4Pzf38lf/xdQQAF/bHjwp96od7gTLgiyCPD//2Off9tZ7gR8xgOK/ydWlojnM/H8jT8LR6CAAgooYNsQ7f9p06sPdAbk7c5/VPH8x151tzj/sQ2I+l+njmkvPoQKvH3/t5rN4vzPViDqf8eljurSMIHrw4xavuxdv1cdq/u/Xtut7iX7v15rVYv9/63Aw78qE8NSJqp3LUkPj65V64qa9pX0s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UYnEE3Fr56B0enbaLxG2i5bI5O/Ijq9d2/dNwKszMZfIc492v49tvnZHp+kh2E4G8kTIji3ejl171tV1F6h3VB7RG+jPFvbc1W3IF4vuDKoofUEdczG2g1TLll1MyS+fQg5JeLBi1qN0N0hYw06mILjow0ziK3UC69xfsznPjNm17fmcYE5BMGV5klTy1eDjN3MFFFBAAQUUUEABBRRQQAEFFFBAAQUUUEABBRRQQAEFFFBAAQUUUEABBRRQQAF/OPhvDsL7JQDwAAA="| base64 -D | gzip -d | tar x

Description of files
soa-config-1.0.mar
MAR archive to be copied to MDS during application deployment. The name of the file is not important. It was not checked if import takes all files or only one.

lib/adf-loc.jar
Marker file containing no Java classes. There is only META-INF/MANIFEST.MF with classpath information adding adf/META-INF/adf-config.xml to application classpath. 

Manifest-Version: 1.0
Class-Path: ../adf

adf/META-INF/adf-config.xml
This is critical configuration file informing ADF layer about associated MDS repository. Content contains MDS description from spa-infra-wls.ear file and use default values for SOA Suite 11g installation.

<?xml version = '1.0' encoding = 'UTF-8'?>
  <adf-mds-config xmlns="http://xmlns.oracle.com/adf/mds/config">
    <mds-config xmlns="http://xmlns.oracle.com/mds/config">
      <persistence-config>
        <metadata-namespaces>
          <namespace path="/deployed-composites" metadata-store-usage="soa-infra-store"/>
          <namespace path="/soa/configuration" metadata-store-usage="soa-infra-store"/>
        </metadata-namespaces>
        <metadata-store-usages>
          <metadata-store-usage id="soa-infra-store" deploy-target="true" default-cust-store="true">
            <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
             <property name="repository-name" value="mds-soa"/>
             <property value="soa-infra" name="partition-name"/>
             <property value="jdbc/mds/MDS_LocalTxDataSource" name="jndi-datasource"/>
            </metadata-store>
          </metadata-store-usage>
        </metadata-store-usages>

        <auto-purge seconds-to-live="3600"/>
        <retry-connection enabled="true"/>
      </persistence-config>
    </mds-config>
  </adf-mds-config>
</adf-config>

META-INF/weblogic-application.xml
Deployable MAR application contain only reference to oracle.mds.lcm.weblogic.WLLifecycleListener class. Other descriptors () typically existing in ADF application are not necessary as deployable MAR application does not contain any ADF related resources [DevADF11g5].

<?xml version="1.0"?>
<weblogic-application xmlns="http://www.bea.com/ns/weblogic/90
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <listener>
     <listener-class>oracle.mds.lcm.weblogic.WLLifecycleListener</listener-class>
  </listener>

</weblogic-application>

Note that the listener is part of JDeveloper Runtime Libraries [AdmADF11g6] and is added to WebLogic installation by SOA Suite installer, probably as JRF (Java Required files) component. It's loaded from $MIDDLEWARE_HOME/oracle_common/modules/oracle.mds_11.1.1/mdslcm.jar.

The listener forwards all work to oracle.mds.internal.lcm.MDSLifecycleListenerImpl which uses oracle.mds.internal.lcm.MDSLCMManager. The latter one seems to do the actual work related to file to MDS transfer.

META-INF/MANIFEST.MF
Contains only version information.

Manifest-Version: 1.0

META-INF/application.xml
To make MAR application a real EAR it needed to add application.xml. Descriptor contains reference to dummy web module. The module does not play any role in transferring MAR into MDS.

<?xml version="1.0" encoding="UTF-8"?>
    <display-name>Offline SOA deployment module. ryszard.styczynski@oracle.com, 2014</display-name>
    <module>
        <web>
            <web-uri>soa-config-info-1.0.war</web-uri>
            <context-root>soa-config-1.0</context-root>
        </web>
    </module>
</application>

soa-config-info-1.0.war
Dummy web archive required by JEE specification for EAR file. There is only index.html containing list of files in MAR. Note that MDS population is triggered by deployment event, thus in normal situation web resource will be not exposed as EAR application will be not started.

Tuning SOA Suite
SOA Suite comes with configuration enabling all components. For some deployment b2b, sdn, and even mediator are not required. Below WLST script configures SOA Suite with following settings:

1. Disables b2b
2. Pauses EDN and set number of threads to 0
3. Minimizes Mediator threads to 2
4. Defines AutodeployDir for soa-infra(seems to be not working feature of SOA Suite)

All the configuration may be done manually by interacting with System MBean browser.

import getopt

def usage():
    print "Usage:"
    print "tuneDownSOA -h host -p port -d soaAutodeployDir [-u user] [-c password] [-s soaServer]"

try:
    opts, args = getopt.getopt(sys.argv[1:], "u:c:h:p:s:d:",
                                  ["user=", "password=", "host=", "port=",
                                   "soaServer=", "soaAutodeployDir="])
except getopt.GetoptError, err:
    print str(err)
    usage()
    sys.exit(2)

user        = ''
password    = ''
host        = ''
port        = ''
soaServer   = 'SOA_Server1'
soaAutodeployDir = ''

for opt, arg in opts:
    if opt == "-u":
        user        = arg
    elif opt == "-c":
        password  = arg
    elif opt == "-h":
        host        = arg
    elif opt == "-p":
        port        = arg
    elif opt == "-s":
        soaServer  = arg
    elif opt == "-d":
        soaAutodeployDir  = arg


connect(user,password,'t3://' + host + ':' + port)
domainRuntime()

b2b = ObjectName('oracle.as.soainfra.config:Location=' + soaServer + ',name=b2b,type=B2BConfig,Application=soa-infra')
edn = ObjectName('oracle.as.soainfra.config:Location=' + soaServer + ',name=edn,type=EDNConfig,Application=soa-infra')
mediator= ObjectName('oracle.as.soainfra.config:Location=' + soaServer + ',name=mediator,type=MediatorConfig,Application=soa-infra')
soainfra= ObjectName('oracle.as.soainfra.config:Location=' + soaServer + ',name=soa-infra,type=SoaInfraConfig,Application=soa-infra')

def printValues():
#check current vlaues
print 'b2b'
print '-------------------'
print 'b2b.donot_initialize'
signature = ["java.lang.String"]
params = ["b2b.donot_initialize"]
print mbs.invoke(b2b, 'getProperty', params, signature)
print 'edn'
print '-------------------'
print 'NumberOfThreads:'
print mbs.getAttribute(edn, 'NumberOfThreads')
print 'Paused:'
print mbs.getAttribute(edn, 'Paused')
print 'mediator'
print '-------------------'
print 'DeferredWorkerThreadCount:'
print mbs.getAttribute(mediator, 'DeferredWorkerThreadCount')
print 'ResequencerWorkerThreadCount:'
print mbs.getAttribute(mediator, 'ResequencerWorkerThreadCount')

print 'soainfra'
print '-------------------'
print 'AutodeployDir:'
print mbs.getAttribute(soainfra, 'AutodeployDir')

print 'Current vaues:'
printValues()

print '---------------------------'
print 'Modifying SOA configuration'
print '---------------------------'
#b2b to be disabled
signature = ["java.lang.String","java.lang.String","java.lang.String"]
params = ['b2b.donot_initialize','true','disabled for gpp']
try:
mbs.invoke(b2b, 'addProperty', params, signature)
except Exception, e:
print e

#edn to be paused
mbs.setAttribute(edn, Attribute('NumberOfThreads',0))
mbs.setAttribute(edn, Attribute('Paused',true))

#mediator to use less threads
mbs.setAttribute(mediator, Attribute('DeferredWorkerThreadCount',1))
mbs.setAttribute(mediator, Attribute('ResequencerWorkerThreadCount',1))

#soainfra to use specified deploy directory
mbs.setAttribute(soainfra, Attribute('AutodeployDir', soaAutodeployDir))

print '-------------------------'
print 'Modification completed'
print '-------------------------'

print 'Modified values:'
printValues()

print 'Done.'

SOA Suite configuration files after tuning
b2b-config.xml
<?xml version='1.0' encoding='UTF-8'?>
<b2b:property>
<b2b:name>b2b.enableMetrics</b2b:name>
<b2b:value>true</b2b:value>
<b2b:comment>Enables B2B DMS metrics for Enterprise Manager.</b2b:comment>
</b2b:property>
<b2b:property>
<b2b:name>b2b.payloadObfuscation</b2b:name>
<b2b:value>false</b2b:value>
<b2b:comment>Enables payload obfuscation</b2b:comment>
</b2b:property>
<b2b:property>
<b2b:name>b2b.donot_initialize</b2b:name>
<b2b:value>true</b2b:value>
<b2b:comment>disabled by Oracle for GPP</b2b:comment>
</b2b:property>
</b2b:b2b-config>

end-config.xml
<?xml version='1.0' encoding='UTF-8'?>
<ns3:thread-count>1</ns3:thread-count>
<ns3:retry-count>3</ns3:retry-count>
<ns3:queueWaitMs>30000</ns3:queueWaitMs>
<ns3:sharedEdn>false</ns3:sharedEdn>
<ns3:paused>true</ns3:paused>
</ns3:edn-config>

mediator-config.xml
<?xml version='1.0' encoding='UTF-8'?>
<ns3:version>11.0.1</ns3:version>
<ns3:DeferredWorkerThreadCount>1</ns3:DeferredWorkerThreadCount>
<ns3:DeferredMaxRowsRetrieved>200</ns3:DeferredMaxRowsRetrieved>
<ns3:DeferredLockerThreadSleep>2</ns3:DeferredLockerThreadSleep>
<ns3:ErrorLockerThreadSleep>5</ns3:ErrorLockerThreadSleep>
<ns3:ResequencerWorkerThreadCount>1</ns3:ResequencerWorkerThreadCount>
<ns3:ResequencerLockerThreadSleep>10</ns3:ResequencerLockerThreadSleep>
<ns3:ResequencerMaxGroupsLocked>4</ns3:ResequencerMaxGroupsLocked>
<ns3:auditLevel>Inherit</ns3:auditLevel>
<ns3:metricsLevel>Disabled</ns3:metricsLevel>
<ns3:ContainerIdInitRetries>5</ns3:ContainerIdInitRetries>
<ns3:ContainerIdLeaseRefresh>60</ns3:ContainerIdLeaseRefresh>
<ns3:ContainerIdLeaseTimeout>300</ns3:ContainerIdLeaseTimeout>
<ns3:Parameters/>
</ns3:mediator-config>


soa-infra-config.xml
<?xml version='1.0' encoding='UTF-8'?>
<ns3:datasourceJndi>jdbc/SOALocalTxDataSource</ns3:datasourceJndi>
<ns3:txDatasourceJndi>jdbc/SOADataSource</ns3:txDatasourceJndi>
<ns3:cache-config>
<ns3:policy name="InMemory" active="true"/>
<ns3:policy name="Coherence" active="false"/>
</ns3:cache-config>
<ns3:audit-config>
<ns3:level>Production</ns3:level>
<ns3:compositeInstanceStateEnabled>false</ns3:compositeInstanceStateEnabled>
<ns3:bpelRecoveryStatus>All</ns3:bpelRecoveryStatus>
<ns3:excludeBelMaxCreationTime>5</ns3:excludeBelMaxCreationTime>
<ns3:policy name="Immediate" active="true"/>
<ns3:policy name="Deferred" active="false">
<ns3:property name="maxThreads">10</ns3:property>
<ns3:property name="flushDelay">5000</ns3:property>
<ns3:property name="batchSize">100</ns3:property>
</ns3:policy>
<ns3:instanceTrackingAuditTrailThreshold>1048576</ns3:instanceTrackingAuditTrailThreshold>
<ns3:bpelRecoveryAlertDurationInDays>7</ns3:bpelRecoveryAlertDurationInDays>
</ns3:audit-config>
<ns3:nonFatalConnectionMaxRetry>0</ns3:nonFatalConnectionMaxRetry>
<ns3:globalTxMaxRetry>2</ns3:globalTxMaxRetry>
<ns3:globalTxRetryInterval>3</ns3:globalTxRetryInterval>
<ns3:oracle.webservices.chunkSize>0</ns3:oracle.webservices.chunkSize>
<ns3:oracle.soa.uddi.cache.lifetime>86400</ns3:oracle.soa.uddi.cache.lifetime>
<ns3:validateSchema>false</ns3:validateSchema>
<ns3:ednJmsMode>false</ns3:ednJmsMode>
<ns3:autodeployDir>${CFG_AUTODEPLOY}</ns3:autodeployDir>
<ns3:multiTenantMode>false</ns3:multiTenantMode>
<ns3:createWSCallTrackingMBean>false</ns3:createWSCallTrackingMBean>
</ns3:soa-infra-config>

Truncation of MDS tables
During tests of the solution below PL/SQL block is useful. It truncates all data from tables. Should be used on a session with MDS user as defined in jdbc/mds/MDS_LocalTxDataSource. Be aware that this code removes everything from MDS: configuration, product related files, deployed composites. Everything. Good thing is that deployment of Deployable MAR and soa-infra-wls.ear will write all files back to MDS.

declare

begin

for c1 in (select table_name, constraint_name from user_constraints) loop
    begin
        execute immediate ('alter table '||c1.table_name||' disable constraint '||c1.constraint_name);
    end;
end loop;

for t1 in (select table_name from user_tables) loop
    begin
        execute immediate ('truncate table '||t1.table_name);
    end;
end loop;

for c2 in (select table_name, constraint_name from user_constraints) loop
    begin
        execute immediate ('alter table '||c2.table_name||' enable constraint '||c2.constraint_name);
    end;
end loop;

end;
/


###

No comments:

Post a Comment