Showing posts with label SOA. Show all posts
Showing posts with label SOA. Show all posts

Tuesday, July 17, 2012

What is T3, soadirect, sb? When to use them?

Weblogic installation provides a range of standalone client that access WebLogic Server applications range from simple command-line utilities that use standard I/O to highly interactive GUI applications built using the Java Swing/AWT classes.

T3: RMI communications in WebLogic Server use the T3 protocol to transport data between WebLogic Server and other Java programs, including clients and other WebLogic Server instances. A server instance keeps track of each Java Virtual Machine (JVM) with which it connects, and creates a single T3 connection to carry all traffic for a JVM.  

SOADIRECT: The SOADIRECT transport provides native connectivity between Oracle Service Bus and Oracle SOA Suite service components. Oracle SOA Suite provides a "direct binding" framework that lets you expose Oracle SOA Suite service components in a composite application, and the Oracle Service Bus SOA-DIRECT transport interacts with those exposed services through the SOA direct binding framework, letting those service components interact in the service bus layer and leverage the capabilities and features of Oracle Service Bus.

SB Transport: SOA Suite can invoke Oracle Service Bus proxy services with an SB transport binding, including the transaction and security context using the direct binding reference.
You can google for more details on each of them. Now, all of the above internally uses RMI/t3 for protocol for communication   But, I could not find any specific internals about how t3 works and most importantly how to load balance these using software/hardware load balancer. In this blog, I will reveal the details that I got from the experts:

1.  Can you loadbalance t3 connections?

You cannot explicitly load balance t3 connections. So, even if you put a hardware/software loadbalancer in front of SOA/OSB/Weblogic cluster it would not help. Yes, the initial connection request will go through the load balancer (only as part of connection establishment i.e. as an alternative to DNS round-robin) but after the intial connection is established, it will stay for the lifetime of the server or client. Once a connection(t3) is established, it consistently goes routes back to the same server directly without going through the loadbalancer. If the connection fails, the loadbalancer doesn't attempt to re-establish it. Responsibility for failover and reconnection remains with the t3 protocol itself.

2. What happens when the client/SOA/OSB requests a t3/soadirect/sb connection?

In general, t3 takes care of its own load balancing (stateless stubs will round-robin calls; stateful stubs will be sticky, with appropriate failover), but requires unfettered access to establish connections to the target servers. Further, once a client has made a connection to one node in the cluster, it learns about all cluster members (regardless of the contents of the URL used to connect); and is actively notified of the member health so it will rarely try to contact a server that is not running. T3 is a stateful protocol; once a connection has been established, the LB cannot re-route it. Responsibility for failover and reconnection must remain with the RMI stub.

3. What happens if the connection is dropped?

Once the channel (t3) is established, the two endpoints will issue regular heartbeats and keep the connection alive.

4. how can you loadbalance your t3 connections?


No, you cannot loadbalance them so it is recommended to not use it until you need to propogate transactions as t3 provides transactional capabilities. You may some link specifying that soadirect/sb/t3 is faster than regular http/ws but I would recommend don't believe it until you test it in your environment.

Bottom line: Use sb/soadirect/t3 only if you need to propogate transactions between end systems else don't use it!!

Saturday, July 2, 2011

BPEL XPath function to retrieve values from a list

In BPEL, if you would like to look through a list of XML elements and check certain condition in each element then follow the steps below:

Sample XML:
<employees>
<employee>
<name>NAME1</name>
<age>25</age>
</employee>
<employee>
<name>NAME2</name>
<age>30</age>
</employee>
<employee>
<name>NAME3</name>
<age>35</age>
</employee>
</employees>

We can use "While" Activity for looping through multiple elements but the real task is to access the data within each dynamically:

1. Initialize a simple int "counter" variable and set the value = 0

2. Count the number of employee nodes in employees root node using,
ora:countNodes("employees/employee")
[Note: Use BPEL Expression builder to get the XPath Expression but remember to delete bpws:getVariableData from the expression because we are not looking for data but only number of nodes]

3. Loop through each of the employee node and check if the <age> is greater than 26 as:

bpws:getVariableData('employees','part',"employee[position()=bpws:getVariableData('counter')]")

4. Increment the counter and you will be able to a access all the employee data dynamically.

Things to remember:

1. In BPEL, the index starts with 1 and not 0 so make sure the "counter" value starts from 1 and not 0.
2. Whereever in the XPath you are accessing a variable inside a variable such as, { "employee[position()=bpws:getVariableData('counter')]" } use double quotes for outside variable and single quotes for inside variable
3. Use position() function as shown above

Monday, July 20, 2009

How to change the JAVA version used to run a specific OC4J instance

1. Using Application Server Control Web Interface

Overview
--------
(a) Ensure the Application Server Control web application is running
and accessible from a browser.
(b) Access the Application Server Control application, drill down to
the configuration pages for the desired OC4J instance and enter
the path of the desired java executable as the "Java Executable"
value under "Command Line Options".
(d) Reload opmn using "opmnctl reload" so that it can pick up the
configuration changes.
(e) Start/Restart the desired OC4J instance with the new java executable
in place.

Detailed Approach
-----------------
(a) Ensure the Application Server Control web application is running
and accessible from a browser.

Identify the correct Application Server Control port (typically 1810).
The port can be determined by inspecting the file:

${ORACLE_HOME}/install/portlist.ini

which contains an entry similar to:

[Ports]
Oracle HTTP Server port = 7777
:
:
Application Server Control port = 1810

Access the appropriate URL for the Application Server Control:

http://yourHost.your.domain:1810/

and login as the ias_admin user with the ias_admin password provided
at installation time.

(b) Using Application Server Control application, drill down to
the configuration pages for the desired OC4J instance and enter
the path of the desired java executable as the "Java Executable"
value under "Command Line Options".

Under the "Home" tab of the main page, identify the desired OC4J
instance in the "System Components" list and click on the hyperlink
assosciated with it's name.

On the OC4J instance page, click on the "Administration" tab and on
the resulting page under the "Instance Properties" section, click on
the "Server Properties" link.

On the next page:

- scroll down to the "Command Line Options" section
- enter the full path to the "java" binary as the value provided
for the "Java Executable" field
- click on the "Apply" button

The validity of the provided path can be confirmed by running the same
path at a command prompt window with a "-version" flag. For example,
assuming "Java Executable" field value of /usr/j2sdk1.4.2_10/bin/java,
run:

% /usr/j2sdk1.4.2_10/bin/java -version

and confirm that this produces output similar to the following:

java version "1.4.2_10"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_10-b03)
Java HotSpot(TM) Client VM (build 1.4.2_10-b03, mixed mode

(d) Reload opmn using "opmnctl reload" so that it can pick up the
configuration changes.

Though Application Server Control will have automatically updated
the centralized copy of the opmn.xml file, it is still necessary togate
restart or reload opmn so that it re-reads it's updated configuration file:

% opmnctl reload
opmnctl: reconfiguring opmn...
opmnctl: opmn reloaded successfully...

(e) Start/Restart the desired OC4J instance with the new java executable
in place.

Finally, it will be necessary to stop any current running instance of the
desired OC4J instance so that opmn can be used to start a new instance
with the modified java executable.

You can navigate back to the top OC4J instance page under Application
Server Control and press the "Start" or "Restart" buttons.


2. Manually applying configuration file changes

Overview
--------
(a) Backup the current OPMN configuration file.
(b) Edit "opmn.xml" and set "java-bin" attribute within the opmn XML entries
for the desired OC4J instance to point to the desired "java" executable.
(c) Propagate the changes in this configuration file to the
configuration repository using "dcmctl updateConfig -ct opmn -v -d".
(d) Reload opmn using "opmnctl reload" so that it can pick up the
configuration changes.

Detailed Approach
-----------------
(a) Backup the current OPMN configuration file.

Make an additional copy of $ORACLE_HOME/opmn/conf/opmn.xml, so
that it can be referenced later or restored to it's original
condition:

% cd $ORACLE_HOME/opmn/conf
% cp opmn.xml opmn.xml.orig

(b) Edit "opmn.xml" file and locate the start of the XML entries
relating to the desired OC4J instance, for example:

<process-type id="myOc4J" module-id="OC4J">
<module-data>
<category id="start-parameters">

Check if the child elements for the "start-parameters" tag
contains a "java-bin" entry as shown below:

<category id="start-parameters">
<data id="java-options" value="-server -Djava.security.policy=
/as9/app/oracle/product/mid90420a/j2ee/myOc4j/config/java2.policy
-Djava.awt.headless=true"/>
<data id="oc4j-options" value="-properties"/>
<data id="java-bin" value="/path/to/java_home/bin/java"/>
</category>

If a java-bin entry does not exist, create one after the "oc4j-options"
entry as shown above.

Ensure that the "value" attribute is an absolute path to a "java" exutable
located in the "bin" sub-directory of a java installation. Confirm that
the value is appropriate by executing that path using the "-version"
argument.

For example, for a J2SDK installed at the location:

/usr/j2sdk1.4.2_10

The XML entries would look similar to the following:

<category id="start-parameters">
<data id="java-options" value="....."/>
<data id="oc4j-options" value="......"/>
<data id="java-bin" value="/usr/j2sdk1.4.2_10/bin/java"/>
</category>

Confirm the validity of value provided as the "java-bin" by executing
at the command prompt:

% /usr/j2sdk1.4.2_10/bin/java -version
java version "1.4.2_10"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_10-b03)
Java HotSpot(TM) Client VM (build 1.4.2_10-b03, mixed mode)

(c) For Application Server 9.0.4.x and 10.1.2.x versions only, propagate
the changes in this configuration file to the configuration repository
using "dcmctl updateConfig -ct opmn -v -d"

After making any manual change to a configuration file it is
necessary to run an appropriate "dcmctl updateConfig" command to
propagate the change to the configuration repository.

In this case where changes have only been made to "opmn.xml", these
can be propagated by running:

% dcmctl updateConfig -ct opmn -v -d

(d) Reload opmn using "opmnctl reload" so that it can pick up the
configuration changes

If the OPMN process is not running, the configuration changes will
take effect the next time opmn is started using:

% opmnctl start
opmnctl: opmn started

If opmn is already running, reload it using the following command,
which will force it to reload it's configuration file:

% opmnctl reload
opmnctl: reconfiguring opmn...
opmnctl: opmn reloaded successfully...

(e) Start/Restart the desired OC4J instance with the new java executable
in place.

Finally, it will be necessary to stop any current running instance of the
desired OC4J instance so that opmn can be used to start a new instance
with the modified java executable.

From the command line, use the following "opmnctl" commands which
illustrate how to stop/start an OC4J instance named "myOC4J":

% opmnctl stopproc process-type=myOC4J
% opmnctl startproc process-type=myOC4J

Search This Blog