Friday, December 18, 2009

Some Tips on Oracle FMW 11g Clustering: deployment and configuration

In this blog-posting, I share some first tips on Oracle FMW 11g (11.1.1.2/PS1) cluster-wide deployment and cluster configuration based on my first experiences with setting up such an environment.

Most tips come from these two documents:
- Enterprise Deployment Guide for Oracle SOA Suite
- Oracle FMW 11g High-Availability Guide


Cluster-wide deployment tips
  • More info on SCA deployment with Ant can be found through my previous posting
  • Deploy a composite to a specific node of the cluster: the deployment coordinator in the Oracle FMW 11g cluster infrastucture will take care of the correct propagation to all the other nodes or rollback in case of a failure on a specific node. For more info on this have a look here.
  • Set up Oracle Coherence for unicast communication during cluster-wide deployments. Have a look here for more details.

Configuration tips
  • Make sure you set the value of the serverURL and the callbackServerURL to the front-end SOA cluster location. In most cases this will be the endpint of the front-end loadbalancer. If you have set the SOA Cluster Front-End URL in the Oracle Weblogic Server Administration Console (location: Clusters -> ) its value will be used for the serverURL and callbackServerURL.
    Note: For unclear reasons, I solved cluster-wide deployment problems by setting the server- and callbackServerURL.
  • You can apply configuration changes to any specific node in the Oracle FMW 11g SOA cluster. Oracle WebLogic Clusters takes care of automatic configuration synchronization across all the nodes of the cluster.

I hope to share more tips here in the near future.

Monday, December 07, 2009

Oracle Fusion Middleware 11g purge scripts available on Oracle Metalink

On Oracle Metalink there is now a Note available that describes the usage of the FMW 11g purge scripts. Note 815896.1 contains all the details.

An OPatch patch 8328187 is available for download that contains all the scripts that are required to create the purging functionality in the SOA_INFRA schema

How to set-up a common Ant project for using the Oracle FMW 11g B2B Ant tasks

Inspired by this great blog posting about how to use the FMW Ant tasks to deploy a SOA composite, I started to use that example to set up my own Ant project for B2B management purposes.

In this blog-posting, I will give an example project that is capable of importing and exporting CPAs to and from Oracle FMW 11g B2B.

Setup the build project
In JDeveloper, create an empty project and name it fmw-build for example. Create the following *.properties
  • env.properties
  • dev.jndi.properties
  • dev.cpacpp.properties
Also, import the ant-b2b-util.xml and the ant-soa-common.xml files that are located in JDEV_HOME\bin folder.

The b2bmanagement.properties files contains all the enviroment specific properties and I used the following contents:


deployment.plan.environment=dev

#dev deployment server weblogic
dev.serverURL=http://localhost:8001
dev.overwrite=true
dev.user=weblogic
dev.password=welcome1
dev.forceDefault=true


# global
wn.bea.home=/home/tomhofte/oracle/fmw11gr2
oracle_home=${wn.bea.home}/Oracle_SOA1
java.passed.home=/home/tomhofte/java/jdk1.6.0_17
wl_home=${wn.bea.home}/wlserver_10.3

libs=/home/tomhofte/libs
path.to.antcontrib.lib=${libs}/ant-contrib/ant-contrib-1.0b3.jar


dev.JAVA_HOME=/home/tomhofte/java/jdk1.6.0_17
#Empty home is enough to let it work
dev.ANT_HOME=


The dev.jndi.properties file contains the jndi properties of my local development environment. I used the following contents:


java.naming.provider.url=t3://localhost:8001
java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.security.principal=weblogic
java.naming.security.credentials=welcome1


The dev.cpacpp.properties contains the cpa/cpp import/export properties for my local development environment. Please have a look here for more information about this part. Please note that for importing exporting a CPA you first have to export the design repository and specify the resulting zip file as the input for the CPA/CPP export utility. The contents I used are:


# CPP/A Output files
oracle.tip.b2b.ebms.OutputFolder=b2b-tmp/output/

# Oracle B2B Metadata File in case of CPA Export
oracle.tip.b2b.ebms.Document=b2b-tmp/output/Paris.zip

# ebXML CPA File incase of CPA Import
#oracle.tip.b2b.ebms.Document=/tmp/input/cpa-example-2_0.xml


# Host Name
oracle.tip.b2b.ebms.Host=Berlin
# Host endPoint Details
oracle.tip.b2b.ebms.HostEndPoint=http://localhost:8001/b2b/transportServlet
# Host Certificate Alias
oracle.tip.b2b.ebms.HostCertificateAlias=Berlin
# Trading Partner Certificate Alias
oracle.tip.b2b.ebms.TPCertificateAlias=Paris
# BPSS Export
oracle.tip.b2b.ebms.BPSSExport=false

#Log config
oracle.tip.b2b.ebms.LogFolder=b2b-tmp/output/log/
# DEBUG|INFO|ERROR
oracle.tip.b2b.ebms.LogLevel=DEBUG
# text|xml
oracle.tip.b2b.ebms.LogType=text


Now that all required property files are in place, I use an Ant wrapper script to call the tasks in the ant-b2b-util.xml file and provide the necessary properties. Just as is done in this posting. Here are the contents of my b2b-management.xml file:

(Note: for layout purposes I had to use explicit XML end tags..:()






























Note: In the ant-b2b-util.xml I had to replace the oracle.home property with a oracle_home named property to be able to use my own oracle home property. At least, this is the case when I execute the script from JDeveloper 11g. Apparently, the oracle.home property file is predefined by JDeveloper, because I get an "Override ignored" message.. I think it won't matter when you execute the script from the command line..

More info about the usage of the tasks defined in the ant-b2b-util.xml can be found here:

http://download.oracle.com/docs/cd/E15523_01/integration.1111/e10229/scrpt_imp_exp_dep.htm#CEGBDIDB

Wednesday, November 25, 2009

How to change BPEL 11g preference values during deployment time

How you can set BPEL preferences in 11g during design time in JDeveloper and run-time in the EM console is described here (for the latter look in the comments for a reference).

Sometimes it is useful to change the preference values during deployment time, because preferences hold environment specific values. Actually, this is pretty easy by using composite deployment configuration plan(s). One for each target environment.

Right-click on the composite file and generate a deployment configuration plan for your composite. When you open the file, you will find a search/replace construction for the preference.



someValue




Now change the value to the environment specific value, save the config plan and use the config plan during deployment to a specifc environment.

Monday, November 23, 2009

Oracle Fusion Middleware 11g end-to-end tracking using the ECID

In a previous posting I described how you could use composite sensors to enable end-to-end tracking for messages that move through the Oracle Fusion Middleware SCA engine and the B2B engine.

Today, I discovered that you can also use ECID for end-to-end tracking. The B2B application message contains all the tracking properties that are originated from the SCA composite that submitted the message to the B2B engine. With the B2B Report console you are able to search for messages using the ECID. To enable searching on ECID, you have to add the ECID search field to the search panel (use the Add fields button ):




So, the ECID also enables end-to-end message tracking in Oracle Fusion Middleware 11g when message move through the B2B engine. This time completely out-of-the-box.

UPDATE 25-11-2O09: The application message holds the fabric data for in and outbound message from the SCA FMW11g fabric [OLD Disclaimer: I only tested it for outbound communication using the native B2B adapter. Still have to test it for inbound communication and AQ and JMS interfacing with the B2B engine.]

How to configure an ebXML communication in Oracle Fusion Middleware B2B 11g

Oracle Fusion Middleware (OFM) B2B 11g supports many business document and messaging standards. ebXML (Electronic Business using Extensible Markup Language is a B2B messaging standard that is also supported by OFM B2B 11g. Shortly described ebXML enables XML messaging over the Electronic Business messaging Service (basically a SOAP extension), abbreviated as ebMS.

This posting describes how to set-up ebXML messaging using two local OFM B2B 11g (PS1) domains. For simplicity, I will extend my previous B2B example.

Please refer to my previous postings for more info about specific B2B 11g configuration concepts:

- http://tomhofte.blogspot.com/2009/10/how-to-set-up-xml-document-exchange.html

- http://tomhofte.blogspot.com/2009/10/easy-binding-of-oracle-fusion.html

Note
You have to configure both Paris and Berlin. Both configurations are mirrored. Normally, you would use the CPA/CPP import functionality of OFM B2B 11g for this. Unfortunately, I don't have a CPA availabe for this simple demo.

Trading Partners
Configure the hosts and TP in both B2B installations:
  • Paris (receiving role)
  • Berlin (sending role)
(Just use all the defaults, including the TP identification type 'Name')

Configure the document
An ebXML document is defined as a Custom document protocol in OFM B2B 11g. For simplicity, I have used my previous Order document example. I only have to change the document type and definition to resp. configure the ebMS specific properties
  • Action
  • Service
  • ServiceType
  • From role
  • To role

and to configure the inbound document identification. I used the XPATH Identification Expression for identifying inbound documents. Also specify a document routing id in the routing tab (I used Berlin_Order). The routing id can be used to route inbound messages to specific applications.


Delivery Channels
For both Berlin and Paris, I have specified Delivery Channels that uses the ebMS 2.0 protocol (I could use ebMS 1.0..but I prefer newest versions :)). Configuring an ebMS 2.0 delivery channel requires some specific settings. Here are the transport protocol settings that I have used:

  • url: http://host:port/b2b/transportServlet for receiving messages over http
  • Ack mode: async
  • Response mode: none
  • Retry count: 4
  • Retry interval: 2
  • -- Leave all the other setting to their default
Deployment and testing
Deploy the agreements (make sure you configure the capabilities correctly: Berlin is the sender and Paris the receiver in this scenario) on both sides (look here how to configure capabilities and agreements). To test the ebXML configuration, I have used my previous SCA example and modified it for this example. The modifications are in the mediator component, because I have to specify extra B2B adapter properties to allow the B2B engine to identify the agreement. For outbound communication there are two ways to identify an agreement using the B2B adapter in a OFM composite:

1. To and From party + document type and revision. B2B properties:
- b2b.documentTypeName
- b2b.documentProtocolRevision
- b2b.fromTradingPartnerId
- b2b.toTradingPartnerId

2. To and From party + ebMS Action, Service and Service Type:
- b2b.ebms.Service*
- b2b.ebms.ServiceType*
- b2b.ebms.action*
- b2b.fromTradingPartnerId
- b2b.toTradingPartnerId

(*) Those properties are not defined in the JDeveloper Assign activity wizard. You have to manually type in the names in the property selection panel

I used the second option with the following values:
  • action = Order_Action
  • Service = Order_Service
  • Service Type = Order_Service_Type
  • To party = Paris
  • From party = Berlin
Deploy the SCA composite and use the Test functionality of the EM console to run a test case. You can see the exact ebMS message when you click the packed message link in the wire message details screen.

Saturday, November 14, 2009

Installing Oracle Fusion Middleware 11.1.1.2: Tips based on my experience with installing on Kubuntu 9.10

I have installed Oracle Fusion Middleware 11.1.1.2 on my local Kubuntu 9.10 (64bit). This posting contains some tips based on my experience.

Please have a look here to find more details about where to find the new Oracle Fusion Middleware Release.

To install the new release you have to upgrade WLS to 10.3.2 and install the new SOA component again. I decided to throw everything away, download the complete new release including the new RCU and JDeveloper release (don't forget this component!) and install everything again..

Required software:
- Weblogic Server 10.3.2 generic (I have a 64 bit config)
- JDeveloper 11.1.1.2
- SOA Suite 11.1.1.2
- RCU (See additional software section)

Please follow the installation instructions, which can be found here, to install the components in the correct order.

JDK issues
With my default OpenJDK version (build#16) I encountered problems with the WLS installer and with starting the installer of the SOA Suite component.

The WLS installer only started in console mode:

tomhofte@tomhofte-laptop:~/downloads$ java -jar wls1032_generic.jar
Unable to instantiate GUI, defaulting to console mode.
Extracting 0%....................................................................................................100%

<-------------------- Oracle Installer - WebLogic 10.3.2.0 ------------------->

Welcome:
--------

This installer will guide you through the installation of WebLogic 10.3.2.0.
Type "Next" or enter to proceed to the next prompt. If you want to change data entered previously, type "Previous". You may quit the installer at any time by typing "Exit".

Enter [Exit][Next]>

<-------------------- Oracle Installer - WebLogic 10.3.2.0 ------------------->


Not really convenient...

When I tried to start the SOA Suite installer using my OpenJDK as the java runtime the following problem showed up in the console and the installer UI did not show up.

Starting Oracle Universal Installer...


Checking if CPU speed is above 300 MHz. Actual 800 MHz Passed
Checking Temp space: must be greater than 150 MB. Actual 47087 MB Passed
Checking swap space: must be greater than 500 MB. Actual 9507 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2009-11-14_08-16-57PM. Please wait ...
Please specify JRE/JDK location ( Ex. /home/jre ), /bin/java should exist :/usr/lib/jvm/java-6-openjdk
tomhofte@tomhofte-laptop:~/downloads/soa_11112/Disk1$ Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/xawt/libmawt.so


I assumed that something was wrong with my JDK version so I decided to install JRockit Realtime JVM version 6. After installing JRockit Realtime JVM version 6 and using this Java distribution for installing WLS and SOA Suite everything was able to install without any problems. The JRockit version I used is available from here.

Note: this will definitely not mean that FMW 11.1.1.2 will only install with JRockit Realtime JVM version 6! It is only that this made it work for me and in case you hit the same issue you now how I solved it :)


Configuring JDeveloper

After I had installed JDeveloper, I noticed that the SOA Composite editor extension is not part of the JDeveloper 11.1.1.2 bundle as it was with the previous version...so...Go to Help -> Check for Updates and select the SOA Composite editor extension:
Install the extension and restart JDeveloper to activate the update.

Activate the Preview Spring component designer
(Thanks to this posting)
To activate the Spring component in the Component palette of the Composite editor in JDeveloper, you have to change the soa-config.xml file that can be found in JDEV_HOME/integration/seed/soa/configuration. Uncomment the following the part and restart JDeveloper



${SPRING_COMPONENT_NAME_L}
${SPRING_COMPONENT_FOLDER_NAME_L}
spring
.xml
oracle.tip.tools.ide.spring.sca.SCAComponentSpring
${SPRING_COMPONENT_DESC}
${SPRING_COMPONENT_DESC}
/oracle/tip/tools/ide/spring/sca/images/springcomponent.png
/oracle/tip/tools/ide/spring/sca/images/springcomponenticon_dia.png

/oracle/tip/tools/ide/spring/sca/images/springTop.png
/oracle/tip/tools/ide/spring/sca/images/springMiddle.png
/oracle/tip/tools/ide/spring/sca/images/springMiddleShort.png
/oracle/tip/tools/ide/spring/sca/images/springBottom.png
231,231,234
192,194,203



All of the above did the job for me.

Tuesday, November 10, 2009

Monitoring Oracle AQ message systems with SQL based User defined Metrics in Oracle Enterprise Manager

By default Oracle Advanced Queueing (AQ) provides monitoring views (in this posting we use the V_$AQ view) to monitor things like
  • Number of waiting messages per queue
  • Number of expired messages per queue
  • Number of messages on status ready per queue
  • Average waiting time per queue
  • Total waiting time per queue
In large messaging systems it is important to detect possible delays and bottlenecks at an early stage. The above metrics can help you with this. Of course it is possible to write a custom monitoring application to make monitoring information accessible, but in most large environments it makes more sense to use a dedicated monitoring product that is able to monitor your complete application environment and provides a single monitoring console.

Oracle Enterprise Manager (OEM) is such a tool. OEM provides functionality to specify User-defined SQL-based metrics that allows you to easily integrate your own SQL monitoring scripts in OEM together with defined thresholds on the metrics, OEM will trigger alert notifications. The SQL queries below can be used for creating SQL based User-defined metrics in OEM to monitor specific queues on specific aspects:


-- Average wait metric
select dbaq.name, vaq.average_wait from sys.dba_queues dbaq, sys.V_$AQ vaq where dbaq.name in ('SOME_Q_A', 'SOME_Q_B') and dbaq.qid = vaq.qid

-- Total wait metric
select dbaq.name, vaq.total_wait from sys.dba_queues dbaq, sys.V_$AQ vaq where dbaq.name in ('SOME_Q_A', 'SOME_Q_B') and dbaq.qid = vaq.qid

-- Expired messages metric
select dbaq.name, vaq.expired from sys.dba_queues dbaq, sys.V_$AQ vaq where dbaq.name in ('SOME_Q_A', 'SOME_Q_B') and dbaq.qid = vaq.qid

-- Ready messages metric
select dbaq.name, vaq.ready from sys.dba_queues dbaq, sys.V_$AQ vaq where dbaq.name in ('SOME_Q_A', 'SOME_Q_B') and dbaq.qid = vaq.qid;



Notes:
  • The queries are Two-Column queries and the Metric type is Number
  • Determine a correct value for Consecutive Occurrences Preceding Notification option to prevent false positives
  • Set a correct interval. Keep in mind that monitoring causes some minor overhead...so don't set the interval too small.. 30 minutes should be sufficient in most scenario's

Set up a Weblogic Server 11g (10.3.1) JMS Store and Forward demo

Weblogic Server (supported from 9.x) contains JMS Store-and-Forward (JMS SAF) functionality. Basically this functionality makes it possible to receive messages on a specific server instance (proxy), forward the messages to different Weblogic server instances and process them on those 'hidden' instances or forward them again...In case the processing server is unavailable the message will be automatically redelivered when the server is available again..You can think about many use cases in which JMS SAF can be very useful. For example, in the situation in which you don't want to stop the message communication when an update of 'processing logic/functionality is needed, JMS SAF can increase the high-availability of your messaging solution. Also it can be used to off-load complex message processing to dedicated servers.

In this posting I will describe how you can set up JMS SAF using Weblogic Server 11g (10.3.1) with a domain configuration consisting out of 1 AdminServer and 2 non-clustered Managed Servers serve in the roles of sender (or actually the forwarder) and receiver.

I skip the domain set up and assume you are familiar with it. To define the JMS SAF resources the best thing to do is to follow the steps that are described Oracle Fusion Middleware 11g SAF guide. I will a not repeat them in this blog.. In its place, I will give additional explanation about specific configuration steps and things you have to do but which are not covered completely in the guide.

Receiving Side - Extra
  • Create a JMS Server
  • Create a Subdeployment in the receiving JMS module and target it to the JMS Server
  • Create a destination queue and remember the JNDI name that you choose. We need it when the sending side will be configured. Target the queue to the JMS module's Subdeployment
  • Create also Connection factory at the receiving side (At least I did it. However, you could try not to create a connection factory, because the sending side never uses it..). In the picture below you can see the configuration of the JMS resources at the receiving side that I have used in my demo:



Sending Side - Extra
  • Create a JMS Connection Factory in the sender JMS module. Use the default settings and and choose a easy-to-remember JNDI name. We need it in the Java client to test the JMS SAF configuration.

Sending Side - Additional notes
- I simply used the default settings for
  • the persistent store of the SAF agent
  • targeting and subdeployment
  • the type of error handling (log). If you decide to use an Error destination, make sure that the queue is targeted to same JMS server/Subdeployment as used for the SAF queue. Most probably, this will mean that you have to create a Subdeployment instead of using the default as I did :)
- For the SAF queue you have to use the JNDI name that you have chosen during the configuration of the destination queue at the receiving side for the remote JNDI location. For simplicity, you can use the same for the local JNDI name
- The JNDI name of the SAF Remote Destination will serve as the prefix of the local JNDI name that you defined for your SAF queue. Keep that in mind when you try to connect to the SAF remote queue (see further on in this posting for in the Java example)


Here's the overview of the JMS SAF resources in the JMS module, which is targeted to the sending server, that I have used in my demo set up:




JMS SAF remote Java client
Now that we have finished the Weblogic Server 11g JMS SAF configuration, we can test it by using a simple Java client. The code fragment below shows the code that you can use to test your configuration. Please note:

  • Import the J2EE 1.5 and Weblogic Remote client libraries in JDeveloper 11g
  • If you are not sure about the exact JNDI binding names for the Connection Factory and JMS destination, you can browse the JNDI tree of the sending server (Admin Console -> Environment -> servers -> -> Configuration/General tab)
  • You can either use '.' or '/' as the separator in your JNDI name


String CFName = "jms/ConnectionFactorySending";
String destName = "jmssaf.RemoteDestjms.Queue_Receiving";

Connection conn = null;
Session session = null;
MessageProducer prod = null;
try{
//Set the Initial Context properties
Properties env = new Properties( );
env.put(Context.SECURITY_PRINCIPAL, "weblogic");
env.put(Context.SECURITY_CREDENTIALS, "welcome1");
env.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL,
"t3://localhost:7004");

InitialContext context = new InitialContext(env);

//Lookup connection factory
QueueConnectionFactory queueConnectionFactory =
(QueueConnectionFactory) context.lookup(CFName);

//Create a connection and session
conn = queueConnectionFactory.createConnection();
session = conn.createSession(false, 0);

//Lookup queue
Queue q = (Queue) context.lookup(destName);

//Send message
prod = session.createProducer(q);
TextMessage msg = session.createTextMessage();
msg.setJMSMessageID(Guid.newInstance().toString());
msg.setText("SAF Test message");
prod.send(msg);

}
catch(NamingException ne){
System.out.println("NamingException: "+ne.toString());
}
catch(JMSException jmse){
System.out.println("NamingException: "+jmse.toString());
}
finally{
try{
prod.close();
session.close();
conn.close();
}
catch(Exception e){
System.out.println("Excepion in finally branch: "+e.toString());
}
}


Run your program to send a message to the sending server. Before you do this make sure the receiving server is not running to check if SAF is working as expected. When the message is submitted, check the Monitoring tab in the Sending SAF agent configuration screen to check if the message is stored and waits for redelivery (from here you are able to perform more management tasks, like pausing forwarding etc.). When you start the receiving server the message will be redelivered automatically to the receiving server..

This blog serves as a starting point for using JMS SAF. More info about all the specific configuration options and monitoring/management options can be found here.

Thursday, November 05, 2009

SOA Suite 10.3.5.1 released: certified with Weblogic Server 10.3.1

SOA Suite 10.1.3.5.1 (aka Oracle Fusion Middleware 1ogr3) has been released. Finally, Oracle BPEL Manager, Oracle ESB, Oracle Rules, OWSM components and all versioned 10.1.3.5.1 are certified with WLS 10.3.1.

Tuesday, November 03, 2009

Oracle Coherence*Web: easy in-memory session management in a clustered environment

Oracle Coherence contains the Oracle Coherence*Web session management module. Oracle Coherence*Web provides in-memory session data management that allows your website to benefit from the high-performance, reliable, high available and scalable data grid solution provided by Oracle Coherence to easily share and manage session data in an application server cluster

In this blog posting, I will use a simple JSF web application deployed on a Weblogic Server 11g instance to show you how easy it is to set-up Oracle Coherence*Web to store session data in a Oracle Coherence data grid.

Coherence and Weblogic 11g configuration
I have used Coherence 3.5.2 and Weblogic 11g (10.3.1) to set up this demo. Coherence 3.5.2 can be downloaded from here and Weblogic Server 11g (10.3.1) from here. Make sure you have patched your weblogic server with patch 6W2W if you use Weblogic Server 10.3

Deploy the coherence-web-spi.war as a shared library to your Weblogic server instance. To start a Oracle Coherence web-session cache server, create a cache-websession-server.sh in the root of your COHERENCE_HOME. Copy/paste the following contents to cache-websession-server.sh:

#!/bin/sh

# This will start a cache server

# specify the Coherence installation directory
COHERENCE_HOME=.

# specify the JVM heap size
MEMORY=512m

if [ ! -f ${COHERENCE_HOME}/bin/cache-server.sh ]; then
echo "coherence.sh: must be run from the Coherence installation directory."
exit
fi

if [ -f $JAVA_HOME/bin/java ]; then
JAVAEXEC=$JAVA_HOME/bin/java
else
JAVAEXEC=java
fi

JAVA_OPTS="-Xms$MEMORY -Xmx$MEMORY"

$JAVAEXEC -server -showversion $JAVA_OPTS -cp "$COHERENCE_HOME/lib/coherence.jar:$COHERENCE_HOME/lib/coherence-web-spi.war" -Dtangosol.coherence.management.remote=true -Dtangosol.coherence.cacheconfig=WEB-INF/classes/session-cache-config.xml -Dtangosol.coherence.session.localstorage=true com.tangosol.net.DefaultCacheServer

That's all what's needed to set up your test environment.

JSF
The web application is a JSF web application consisting of a simple JSF page that displays a button to increase a counter. The counter value is stored in a JSF managed bean (session-scoped) attribute. The managed bean is session scoped to ensure that the counter is saved in the Coherence data grid. Storing the complete managed bean is not a must-have requirement, but it is an easy way and suitable for this simple case. Oracle Coherence provides functionality to determine which objects have to be stored in the Oracle Coherence data grid and which not. This is explained later in this posting.

I assume you know how to make such a simple JSF application so I will skip that. The only thing you have to make sure is that you add the coherence.jar library to your project.

To enable Coherence*Web for in-memory session management, the only thing you have to add is a weblogic.xml file and add the following library reference to it:


<library-ref>
<library-name>coherence-web-spi</library-name>
<specification-version>1.0.0.0</specification-version>
<implementation-version>1.0.0.0</implementation-version>
<exact-match>false</exact-match>
</library-ref>
<library-ref>
<library-name>jsf</library-name>
<specification-version>1.2</specification-version>
<implementation-version>1.2.3.2</implementation-version>
<exact-match>false</exact-match>
</library-ref>

(The JSF reference makes the JSF libraries available to web application)

Bundle the application in a war file and deploy it to the Weblogic Server Domain in the same server in which you have deployed the coherence-web-spi.war.

Note: The JSF application makes use of WAR-scoped Coherence session management. Other variants are EAR-scoped and application server scoped. The last two variant allows you to share session data between web applications...but be careful with this feature!

Test
Start 1 or more Coherence web-session-cache instances to create a Oracle Coherence data-grid by executing the cache-websession-server.sh several times...(notice how easy it is to create a Oracle Coherence cluster and check the logging output to see the Coherence actions to manage the cluster) . Now we have a data grid to store the session data in, you can browse to your web application and hit the button several times to set the counter value. As a final test: shutdown the Weblogic server....wait a second...start the server again and open your web application...the previous counter value is still there!

Other features & benefits
- Session management models
Oracle Coherence*Web supports three different session management models to support different types of web applications:

  • The traditional model -> suitable for small applications with small session objects

  • The monolithic model -> same as traditional model but without object sharing issues

  • The split model -> suitable for web applications with large session object

- Distribution controller
The Coherence*Web distributed controller functionality allows you to manage which objects has to be stored locally in the server heap (only local accessible) or distributed (shared across multiple servers) in the Coherence data grid and at what moment in the life-cycle of a user session a object should be stored in a Coherence data grid. This feature has several useful use cases, for example to reduce the migration effort to migrate a non-distributed application to a distributed one.

Saturday, October 31, 2009

How to use composite sensors to enable end-to-end tracking of B2B messages in SOA Suite 11g

Prior to the 11g release of the SOA Suite end-to-end trackig&tracing of messages send out from OESB or BPEL via Oracle Integration B2B 10g, was not supported out-of-the box, because Oracle Integration B2B 10g was/is not part of the 10.1.3.x SOA Suite Suite. You always had to build custom code to enable end-to-end tracking & tracing of messages in such environments.

Because B2B is now fully integrated into the SOA Suite, it becomes possible to easily end-to-end B2B messages using composite sensors.

How to use composite sensors in common is described here by the Oracle SOA Suite PM team. Ok..but how can you use this feature to end-to-end track B2B messages that are submitted from a composite to Oracle B2B or vice-versa? Actually, it's quite simple. Below I will describe what you have to do at design-time and run-time to track B2B messages using the B2B message id as an example.


Design-time
At the B2B adapter in JDeveloper composite editor we define a composite sensor named order_msgid (assuming you are using the example that I have given in a previous posting on this blog) and assign it the value of the b2b property b2b.messageId.  In my example I use an outbound scenario, so to make it work I have to set the message id in the composite instead of delegating the creation of the message id to B2B. In the mediator component I set the value of the b2b.messageId to the compositeInstanceId. At design time, we are finished now..so deploy your sensorized composite to the server.

Run-time
At run-time we have to add a search field for the defined sensor to be able to search on message ids in the composite instances tab. Go to the instances tab of the composite and click on 'Add fields' and select 'order_msgid'. It will be added to the search form. Note that the SOA engine automatically detects composite sensors! The instances tab should look as follows:



Test the composite by using the EM test screen. Select the new instance and open the instance flow. Unfold the payload of the B2B adapter message and verify that the b2b.messageId property has been set in the properties header:



Log in to the b2b management console (my B2B url: http://localhost:8001/b2b) and open the reports tab and select the business message tab. Select the details of the corresponding B2B message and discover that it has used the message id that has been set by the composite :)




You now can search in the EM composite instances tab for a specific instance using the B2B message id. This becomes very useful when the number of composite instances becomes very large in a production environment and maintenance team quickly wants to track down the flow of a specific B2B message in case of issues with that message..

Tuesday, October 27, 2009

Easy binding of Oracle Fusion Middleware B2B 11g with a SCA composite using the B2B adapter

In my previous posting,I have described how to set up a simple XML document exchange configuratation in Oracle Fusion Middleware B2B 11g. In this posting I will show how to use the new B2B adapter part of SOA Suite 11g to easily send out XML orders from a SCA composite.

The SCA that we are going to build will consist of a simple SOAP interface that accepts new orders. A mediator component will route the order directly to Oracle Fusion Middleware B2B using the B2B adapter. For simplicity, we will use the same XSD structures.

JDeveloper Project and the mediator component
The first step is to create a new JDeveloper SOA project. Start with an empty composite. Drag and drop a new mediator component from the component onto the component panel of the composite diagram. Name the component ProcessOrder. Select the one-way interface type and use the same XSD input structure for the order as used in the B2B document definition configuration. Also create a composite service with SOAP bindings (checkbox). Click on 'Ok' to create the mediator component. In a later step we will specify the necessary assign and transformation actions.

B2B adapter
In Oracle Fusion Middleware 11g the B2B adapter is introduced to make the  binding of the B2B component with a SCA composite more native. The B2B adapter wizard allows the developer to browse the B2B document repository to easily select the right document type for inbound or outbound messaging with a trading partner.


Drag a B2B adapter from the component palette and drop it onto the reference service swimlane. A wizard will automatically pop up. Name the service B2B_Order_Gateway. Click 'next' and choose default as the integration type. The integration type specifies how SCA will communicate with B2B. Default means that a WSDL file with a native B2B binding will be constructed. AQ means that a JCA AQ WSDL file will be constructed. Click next and select the Fusion middleware server connection for browsing the B2B repository and click next. Choose for the option 'Send', because the composite is going to send out orders and click on next and again on next in the following screen (we use the defaults in that screen :)). In the wizard-screen Document Definition you have to browse to the ComplexOrder_Def and select it as the document definition. Click on next and on finish to complete the wizard. The B2B binding reference service will now be created and added to the SCA composite and the required artifacts will be generated.

Figure 1


Wiring everything together
As one of the last steps, we need to wire the mediator component to the B2B binding reference. You can do this by selecting the orange arrow (will pop-up when you hover over the Mediator component) of the mediator component and hold the left mouse button pressed, drag the mouse to the B2B binding reference service and drop the line on the orange arrow of the B2B binding component. Figure 2 shows the end result.


Figure 2

Double click the mediator component and generate a standard XSLT transformation to transform the input order structure to the expected order structure of the B2B reference service (Note: that JDeveloper recognises that the B2B binding reference expects a specific XML structure. Magic, isn't it? :)). Instead of using XSLT, we could also use an Assign action here.
The last thing we have to do is to inform the B2B binding reference service that we want to send an order to Acme from the host MyComposite. We use the Assign values option of the mediator component and two of the available B2B properties for this. Assign:

Acme -> b2b.toTradingPartnerId
MyCompany -> b2b.fromTradingPartnerId

(See Figure 3 for assigning properties)


Figure 3

 Save your project and deploy it to your Oracle Fusion Middleware server and use the built-in composite test functionality of the EM console to test your SCA composite. If you have implemented the composite correctly and configured B2B correctly as well (as described in my previous posting) you will see an order in the Acme outbound file directory that you have chosen during B2B configuration after you have executed test.

'A child can do the laundry' as we name easy procedures like this in my country :)

Sunday, October 25, 2009

How to set up a XML document exchange configuration in Oracle Fusion Middleware B2B 11g

In the new 11g release of the Oracle SOA Suite,  B2B is fully integrated in Oracle's SOA stack. The engine and the UI console are enhanced and improved on several parts compared to the 10g release of Oracle Integration B2B.

In this blog posting, I show you how to set up a XML document exchange configuration. It will also let you experience the renewed B2B Console based on ADF Faces technology. The case will consist of a custom XML document (Order), a single trading partner Acme and an agreement that specifies that MyCompany (the default host) is capable of sending out XML orders to Acme.

Log on to the B2B console. If you are familiar with the 10g console, you will immediately notice the new look-and-feel and the way things are organized (see figure 1).

Figure 1

Trading Partner
First we have to create a new trading partner. Click on the green plus sign on top of the Trading Partner (TP) panel on the left side of the screen.  Name the new TP Acme and click on ok. The next thing we have to configure is the type of document that we want to exchange with Acme.

Document definition
Documents are managed in the Administration window. So click on the Adminstration link at the top of the screen and open the Documents tab on new page. The left panel shows the supported document protocols. Select the Custom protocol and click on the green plus sign to add a new Custom Revision. In the form set the name to Custom_1.0 and click on save. Select the Custom_1.0 revision in the left panel and again click on green sign to add a document type. In the form set the name to XMLDocumentType and click on save. In the left panel select the XMLDocumentType and click on the plus sign to add a document definition. In the form set the name to ComplexOrder_Def, the Identification Type to XML. In the Definition field you have to the set the xsd structure of the complexOrder. Can be anything and I assume you know how to define a XSD structure. Leave all the other fields untouched, because we don't need them for this simple case.  See figure 3 for an example of the protocol tree in the left panel and the completed Document definition form.


Figure2


Ok, by know you have probably experienced the usability of the renewed B2B console. In my opinion the new Oracle Integration B2B 11g console enables you to keep a better overview of what you have configured and where you are in a specific configuration part, e.g. setting up new documents.

Document capability
Now we have to add a capability to the TP Acme to inform the B2B engine that Acme is capable of receiving XML orders from our side. Go back to the Partner page (Partner link at the top of the page). Select Acme in the trading partner and in the right panel select the Document tab and click on the green plus sign at the Documents overview to add new a document capability. In the Select document definition pop-up screen unfold the Custom tree and select the ComplexOrder_Def definition and click on Add. Make sure that only the receiver checkbox is checked; we are only going to send orders to Acme. Click on save to save the capability. B2B automatically adds a dual capability to MyCompany for the same document definition and the dual direction that you have specified at the trading partner side. Check it. Figure 3 shows the Trading Partner document screen


Figure 3


Delivery Channel
The next thing that we need to configure is the channel on which Acme wants to receive the orders. For simplicity, we use the file system as the transport protocol. Oracle B2B also supports e.g. FTP, JMS, Email, HTTP. Click on the channels tab in the right panel of Trading Partner Acme. Click on the green plus sign and set the protocol to file and the name to Acme_File_Channel. At the bottom of the page set the transport protocol parameters and the channel parameters to your own need. Note: you can use placeholders in the filename format field. I used this format:

order_%MSG_ID%.xml

More available placeholder can be found here.  Click on save when you are done.

Agreement and deployment
At this point we have set uo the exchange document type, TP capabilities and the Acme delivery channel. We are now ready to create an agreement. On the Partner page click on the green plus sign to add a new agreement. Figure 4 shows you how to fill in all the fields in the Agreement form.

Figure 4

After you have completed the form, save the agreement. Before we can deploy the agreement we first have to validate it; click on validate and finally on deploy to make the agreement active. We are now ready to send out orders to Acme :)

This blog has shown how to setup a simple document exchange configuration in Oracle Fusion Middleware B2B 11g. In a next posting I will describe how the new B2B adapter in 11g can be used to construct and send out orders from a composite using a BPEL or Mediator component.


Thursday, October 22, 2009

Oracle Coherence 3.5.2 available

Last week Oracle released Oracle Coherence 3.5.2. The version contains several improvements and enhancements for Oracle Coherence 3.5. The improvements and enhancements are listed here. You can download the new version from here.

More info about Oracle Coherence 3.5, user guides etc, can be found on the Oracle Coherence wiki.

Wednesday, October 21, 2009

SOA Suite 11g: Coordination between two BPEL processes

While scanning the FMW 11g SOA Suite developer guide, I noticed the feature that enables coordination between master and detail BPEL processes by using so- called signals.

As far as I know, this feature is introduced in 11g and is very useful in situations where a parent process has to control the processing of the child processes. And, vice versa, where child processes has to notify their parent process when a specific task is completed. Most of the time a signal is enough and no additional information has to be sent along. Therefore, for example, a BPEL invoke activity with correlation might be a bit too complex for this purpose.

Ok how does it work? The tutorial gives you a clear explanation how to use signaling in Oracle BPEL so I will describe the rough details about how you can use signaling and also some limitations that I discovered while praticing with this feature.

How-to
  1. Create a BPEL master detail proces in the composite.
    • Use the process type asynchronous for the master process and the the type one-way for the detail
  2. Add an Invoke activity to the master process to invoke the detail process
    • Open the source view of the BPEL editor and add the following property to the invoke activity:

      bpelx:invokeAsDetail="true"

  3. Add a Wait activity to the master process for demo purposes
  4. Add a Signal activity to the master process
    • Remember the Label value
    • Set the To value to details
  5.  Add a Receive Signal activity to the master process
    • Remember the Label value
    • Set the From value to details
  6.  Add a Receive Signal activity to the detail process
    • Use the Label value used in step 4
    • Set the From value to master
  7. Add a Wait activity to the detail process for demo purposes 
  8. Add a Signal activity to the detail process
    • Use the Label value used in step 5
    • Set the To value to master
  9. You're done! Deploy the composite to the server and test your composite.
The signaling feature also supports correlation to correlate signals between the master and different detail process types. It seems that correlation of signals between different composite master/detail instances are correlated automagically.

Unfortunately, the coordination functionality has some limitations:
  • Labels can not be set dynamically using XPath
  • Correlation labels can not be set dynamically using XPath
  • Only a single signal pair (signal/receive signal) can be used for a unique label
These limitations make it, for example, not possible to coordinate by using signals between a master and multiple detail instances of the same BPEL process type which are invoked in parallel or even sequential..

Oh..I still have to figure out how signaling is implemented 'under the hood'.. However, happy signaling...

Tuesday, October 20, 2009

Oracle SOA Suite 11g: Manipulate the SCA composite name at design time

By default no composite name is set when a SCA composite is executed. For runtime monitoring and tracking purposes it might be useful to set a custom name at design time for your SCA composite.  Especially, when the number of instances increases in production.

By using embedded Java for BPEL components and XPath for Mediator components you are able to manipulate the title of a SCA composite during design time.

XPath for Mediator components:
Use the the following XPath expression in an Assign value dialog when you define a routing rule.

med:setCompositeInstanceTitle(title string)

and use the following target tracking.compositeInstanceTitle.
Note: this property will not appear in the property selection dialog, but can be used though.


Java for BPEL components
Add an Embedded Java activity inside your process flow and add the following function to it:

setCompositeInstanceTitle(title string);


(Ok..here it is my first real blog-posting. Any comments on the layout are welcome)

Restart blogging

Hi all,

I recently have decided to start blogging again. I don't no exactly why, but most probably it's due to the fact that I want to share my enthusiasm for SOA and Java technology with you. Especially those with an Oracle flavor..

The main topics of this blog will be:
  • Oracle Service Bus
  • Oracle Fusion Middleware 11g
  • Oracle Coherence
  • other SOA and Java topics
  • and best practices on all of the above named topics
Enjoy reading and don't forget to add this blog to your RSS reader :)