Showing posts with label OSB 12c. Show all posts
Showing posts with label OSB 12c. Show all posts

Saturday, August 16, 2014

OSB 12c Templates for Proxy Pipeline

Oracle Service Bus allows mediation and manage the interactions between disparate systems through a common canonical model & messaging infrastructure. Though the product provide enriched tools to orchestrate complex integration requirements, generally it is  meant for virtualising the interactions between different applications and hence most of the time follows a predictable orchestration pattern in the message flow. In 11g, we have to model these repeatable message flows in every proxy and with 12c we don't need to do that anymore. Luckily with 12c, we have the Proxy Pipeline templates, which allows us to model these repeatable message flows into a template and let the concrete Piplelines generated out of it.

As a first example, we will model a Pipeline Template for a WSDL based message interaction.







Lets take a look at the design palette for the message flow. The highlighted section in the below image shows the placeholders that can be added to the template to provide overriding capability to the concrete pipeline. 



Nodes - Placeholders for Pipeline pair, Branch & Route nodes.
Stages - Placeholders for one or more Stages, which in turn can contain actions.
Actions - Placeholders for one or more Actions.
Route - Placeholder for Route node.
Conditional  - Placeholder for a Conditional Branch
Operational - Placeholder for a Operational Branch

The example template acts as the core template for any WSDL based pipeline and includes the below capabilities :
1)Mapping EBMHeader(Ex:- AIA) information to shared variables to make reporting more meaningful to handle the message correlation. (i.e) the keys can be derived from the information available in the header.
2)Report Request & Response payloads
3)Placeholder for a Operational Branch and create a placeholder route action fora a valid business/proxy service in the available branch.
4)Provide a common error handling pattern.

The final template would like below :


The shared variables ebmID & entity key will hold the EBMID(from AIA Header) &  entity specific id from the business entity respectively. They will acts as the keys for the reporting. Also, another feature in templates is that you can lock  a particular action from being changed at the concrete pipeline.


Lets generate a concrete pipeline:







On clicking the finish button, the generated concrete pipeline/proxy will look like below :





The placeholders are now turned concrete and we can add more components into as per required.

For some reason if we think we need to break the template link, then we can go to Pipeline -> Configuration -> click on the 'Break Template Link' button as shown  below:


Breaking the template link will retain only the concrete elements in the pipeline. We need to be careful as breaking the template link will automatically save the changes (though there will be a warning popup shown to confirm the changes).. there is no going back as far as I could see..

Sunday, June 29, 2014

Maven Support for Oracle Fusion Middleware 12c - SOA/OSB/Coherence

I am sure you are one among many who have been waiting for Oracle to provide native support for building their various technology artefacts through maven. In a way they started doing it from 11gR2, but the support really lacked in terms of built-in plug-in / archetype support for building applications for technologies like SOA,OSB,ADF,Coherence etc.. The main problem was to find a way to describe the dependencies to compile,build & package the artefacts for different projects that are part of the above listed technologies.

With the release of 12c, things have been changing and when SOA 12c was released late last week, I couldn't resist myself to check the maven support as the first thing. 

Oracle Maven Synchronization Plug-in
Oracle Maven Synchronization plug-in provides a mechanism for Oracle to handle library dependencies & technology plug-ins from a Oracle Home perspective (i.e) it allows us to populate the repository for a Oracle Home and any patching going forward will allow us to sync the repository for that particular environment without affecting other installations.

It is shipped with Oracle weblogic server, Jdeveloper & Oracle coherence installation bundles and to install/deploy into a repository, you should provide the Oracle Home details as well to manage the synchronization going forward. When we install the plug-in, it looks for all the maven artefacts in the Oracle Home & installs them in the specified Maven repository. This ensures that the version numbers would match exactly at the binary level ensuring the consistency.

Installation Process
In my laptop, I have a maven local repository and also configured 'Artifactory' as the remote repository. Below shows the remote repository configuration in the maven settings.xml file.



#Maven settings.xml configurations
<servers>
    <server>
      <id>lib-snapshot</id>
      <username>admin</username>
      <password>{jbf3GAd5kk8H/zUwaYzA2dDzabrj+jrSVwN76oM3FZ4=}</password>
    </server>
    <server>
      <id>lib-release</id>
      <username>admin</username>
      <password>{jbf3GAd5kk8H/zUwaYzA2dDzabrj+jrSVwN76oM3FZ4=}</password>
    </server>
    <server>
      <id>plugin-release</id>
      <username>admin</username>
      <password>{jbf3GAd5kk8H/zUwaYzA2dDzabrj+jrSVwN76oM3FZ4=}</password>
    </server>
    <server>
      <id>plugin-snapshot</id>
      <username>admin</username>
      <password>{jbf3GAd5kk8H/zUwaYzA2dDzabrj+jrSVwN76oM3FZ4=}</password>
    </server>
  </servers>
<profile>
      <id>artifactory</id>
      <repositories>
        <repository>
          <snapshots><enabled>false</enabled></snapshots>
          <id>lib-release</id>
          <name>Repository for library release</name>
          <url>http://localhost:8081/artifactory/libs-releases-local</url>
          <layout>default</layout>
          </repository>
        <repository>
          <snapshots></snapshots>
          <id>lib-snapshot</id>
          <name>Repository for snapshots</name>
          <url>http://localhost:8081/artifactory/libs-snapshots-local</url>
          <layout>default</layout>
        </repository>
        <repository>
          <snapshots></snapshots>
          <id>ext-snapshot</id>
          <name>Repository for external snapshots</name>
          <url>http://localhost:8081/artifactory/ext-snapshots-local</url>
          <layout>default</layout>
        </repository>
        <repository>
          <snapshots></snapshots>
          <id>ext-release</id>
          <name>Repository for external release</name>
          <url>http://localhost:8081/artifactory/ext-releases-local</url>
          <layout>default</layout>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
          <id>plugin-release</id>
          <name>Plugin Repository for release</name>
          <url>http://localhost:8081/artifactory/plugins-releases-local</url>
        </pluginRepository>
        <pluginRepository>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
          <id>plugin-snapshot</id>
          <name>Plugin Repository for snapshot</name>
          <url>http://localhost:8081/artifactory/plugins-snapshots-local</url>
        </pluginRepository>
      </pluginRepositories>
    </profile>

    <activeProfiles>
      <activeProfile>artifactory</activeProfile>
    </activeProfiles>

Script to install oracle sync plugin into the local & remote repository.


# setEnv.sh
export M2_HOME=/u01/apps/maven3.1.1
export MW_HOME=$HOME/Oracle/12c/Middleware/Oracle_Home
export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
export ARTIFACTORY_HOME=/u01/apps/artifactory-2.0.1
export PATH=$JAVA_HOME/bin:$M2_HOME/bin:$ARTIFACTORY_HOME/bin:$PATH


#install_oracle_maven_sync_plugin.sh

#Provisioning the environment variables
sh ./setEnv.sh

#Installing the oracle maven sync plugin to the local repository
mvn -X install:install-file -DpomFile=$MW_HOME/oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.1.3/oracle-maven-sync-12.1.3.pom 
-Dfile=$MW_HOME/oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.1.3/oracle-maven-sync-12.1.3.jar -DoracleHome=$MW_HOME

#Pushing all the libraries into the local repository
mvn -X com.oracle.maven:oracle-maven-sync:push -DoracleHome=$MW_HOME -Doracle-maven-sync.testingOnly=false

#Rebuilding the archetype catalog
mvn archetype:crawl -Dcatalog=$HOME/.m2/archetype-catalog.xml

#Deploying all the libraries into a remote repository
mvn -X deploy:deploy-file -DpomFile=$MW_HOME/oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.1.3/oracle-maven-sync-12.1.3.pom 
-Dfile=$MW_HOME/oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.1.3/oracle-maven-sync-12.1.3.jar -Durl=http://localhost:8081/artifactory/plugins-releases-local 
-DrepositoryId=plugin-release

#Pushing all the libraries into the remote library release repository
mvn -X com.oracle.maven:oracle-maven-sync:push -DoracleHome=$MW_HOME -Doracle-maven-sync.serverId=lib-release


The terminal output shows that the plugin was successfully deployed to the remote repository.














Artifactory console showing the successful upload of plugins/libraries.



With all the technology specific plug-ins now loaded, lets describe them one by one:

Service Bus Plug-in

mvn help:describe -DgroupId=com.oracle.servicebus.plugin
-DartifactId=oracle-servicebus-plugin -Dversion=12.1.3-0-0

SOA Suite Plug-in

mvn help:describe -DgroupId=com.oracle.soa.plugin -DartifactId=oracle-soa-plugin -Dversion=12.1.3-0-0

Oracle Coherence Plug-in


mvn help:describe -DgroupId=com.oracle.coherence -DartifactId=maven-gar-plugin -Dversion=12.1.3-0-0


Oracle Weblogic Plug-in


 mvn help:describe -DgroupId=com.oracle.weblogic -DartifactId=weblogic-maven-plugin -Dversion=12.1.3-0-0



Generating Service Bus project from Maven Architype
Now that we have deployed the oracle sync plugin and reloaded the maven archetypes, we can create service bus,soa,coherence projects using them. The below example shows how to generate a service bus application using the built-in archetype

In the New Gallery Select -> Maven -> Generate from Archetype

Click on the Maven Architype LOV to select the servicebus archetype


Search by text 'servicebus' and select the appropriate archetype populated from the local repository.



The Service Bus application has been successfully created using the archetype.




There are two different kinds of project archetypes available for a service bus application. They are :

<groupId>com.oracle.servicebus.archetype</groupId>
<artifactId>oracle-servicebus-project</artifactId>
<version>12.1.3-0-0</version>
<name>Oracle Service Bus - Project Archetype</name>

<groupId>com.oracle.servicebus.archetype</groupId>
<artifactId>oracle-servicebus-system</artifactId>
<version>12.1.3-0-0</version>
<name>Oracle Service Bus - System Resources Archetype</name>

The first one is for the actual service bus project and the second is for the System resources (we will see more about this in coming blog posts). The system resources are a way of sharing resources like JNDI, SMTP & Proxy servers across different service bus projects.

Lets build & package the application..



Build output...


References -
http://docs.oracle.com/middleware/1212/core/MAVEN/introduction.htm#MAVEN8755
http://docs.oracle.com/middleware/1213/osb/develop/osb-maven.htm