Monday 2 October 2017

ANT : Common adf-config.xml to deploy SOA composites to different environments.

When you are using ANT for SOA deployment, It will look for the .adf defined in the scac.application.home location that you have passed to the ant-sca-package file.
By default for ANT it is the \SCA-INF\classes folder under each project.

However, the common adf-config.xml file can be used to deploy all the composites instead of using the adf-config file from the individual composite applications.

By below approach, we can reduce the maintenance of individual adf-config files also by using the same adf-config file the composites can be deployed to different environments.

Steps:

1. Copy.adf folder from any of the composite application to the common location.
2. Change the contents of the adf-config.xml like below (change the file according to your requirement.)

<?xml version="1.0" encoding="windows-1252" ?>
<adf-config xmlns="http://xmlns.oracle.com/adf/config" xmlns:adf="http://xmlns.oracle.com/adf/config/properties"
            xmlns:sec="http://xmlns.oracle.com/adf/security/config">
  <sec:adf-security-child xmlns="http://xmlns.oracle.com/adf/security/config">
    <CredentialStoreContext credentialStoreClass="oracle.adf.share.security.providers.jps.CSFCredentialStore"
                            credentialStoreLocation="../../src/META-INF/jps-config.xml"/>
  </sec:adf-security-child>
  <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="/apps" metadata-store-usage="mstore-usage_1"/>
          <namespace path="/soa/shared" metadata-store-usage="mstore-usage_2"/>
        </metadata-namespaces>
        <metadata-store-usages>
          <metadata-store-usage id="mstore-usage_1">
           <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
            <property
name="jdbc-userid" value="DEV_MDS"/>
            <property
name="jdbc-password" value="devmds"/>
            <property
name="jdbc-url" value="jdbc:oracle:thin:@//localhost:1521/XE"/>
            <property
name="partition-name" value="soa-infra"/>
           </metadata-store>
            </metadata-store-usage>
            <metadata-store-usage id="mstore-usage_2">
           <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
            <property
name="jdbc-userid" value="DEV_MDS"/>
            <property
name="jdbc-password" value="devmds"/>
            <property
name="jdbc-url" value="jdbc:oracle:thin:@//localhost:1521/XE"/>
            <property name="partition-name"
value="soa-infra"/>
           </metadata-store>
          </metadata-store-usage>
        </metadata-store-usages>
      </persistence-config>
    </mds-config>
  </adf-mds-config>
</adf-config>



3. Set the scac.application.home to the common location in step1 path during the deployment of the composites.The common adf-config.xml file will be used to deploy all the composites.

We are using DB-based MDS here.
You can also use the File-based connection, but make sure to change the metadata-path to the physical path of the MDS folder.

Example:
<metadata-store-usage id="mstore-usage_2">
      <metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
      <property name="partition-name" value="seed"/>
      <property
name="metadata-path" value="E:/Oracle/Middleware/Oracle_Home/soa/integration"/>
      </metadata-store

</metadata-store-usage>


Helpful? Please Comment.

Happy Learning!!

No comments:

Post a Comment

OSB 12c : Dynamic Routing to Business/Proxy Service

Dynamic routing is a kind of  Content-based Routing pattern, which is used when the BusinessService/ProxyService path is required to be de...