Search This Blog

Saturday, June 15, 2013

SOA Retire Activate Composites


Why we need retire and activate composites?

Before you go for bouncing the SOA Suite Domain which contains SOA, ADF Clusters with multiple managed servers, where each Weblogic server hosted all the sessions which are in execution state on them must be persisted to a restore further when Servers back to RUNNING state. To make this possible we need to use the retire composites and then after RUNNING servers bring them back to activate state for service.

Here is a sample trail script where the SOA application composites management. Here you need to navigate to the wlst.sh or cmd path. To access SCA function you must start WLST from /common/bin. When trying to run the SOA WLST command from regular 'java weblogic.WLST' cannot execute the SCA functions. When you try to execute the sca_retireComposite() it could throw the 'NameError'. So the cause is started WLST from the wrong location, to avoid that our PATH is to change and run the script from the following path: $SOA_ORACLE_HOME/common/bin/wlst.sh will work on Unix/Linux environments. Similarly you choose for Windows environment instead of using executing the shell script you need to use 'call' in the batch script.

Here the major task we have proceeding with the following two functions.

  1. Retire is to retire the composites .
  2. Activate is to activate the composites.
loadProperties('/user/test/scripts/composites.properties')
def retireComposites(Soahost,port, username,password,scacompositename, ver):
        sca_retireComposite(Soahost, port, username, password, scacompositename, revision=ver, partition='default') 
def activateComposites(Soahost,port, username,password,scacompositename, ver):
        sca_activateComposite(Soahost, port, username, password, scacompositename, revision=ver, partition='default')
if __name__== "main":
        print "1.To retire composites"
        print "2.To activate composites"
        print "3.Exit from Menu"
        ch=input('Enter Your Choice: ')
        f=open('/user/test/scripts/composites.txt','r')
        if ch== 1 :
                for c in f:
                        c=c.rstrip('\n')
                        retireComposites(Soahost,port, username,password,c, ver)
        elif ch == 2 :
                for c in f:
                        c=c.rstrip('\n')
                        activateComposites(Soahost,port, username,password,c, ver)
        else:
                exit()
        f.close()

Here is the composite.txt sample, where you can specify your composites configured in the SOA partition. Which are usually visible on enterprise manager(em) console. Oracle must given a easy module for displaying the deployed SCA composites list. Anyway we have stored in a separate file as shown below. You have flexibility of changing the order when you use this composite.txt file.

B2B_BPEL_TEST_Sub_reccive
B2B_BPEL_TIBCO_PUB_invoke

The actual trouble started when we tried to use a separate composite.txt file. each line can be read and the value always having at the end an EOL ( \n ). To supress that escape sequance we have used python scring function rtrip function.

The regular properties file which is loaded on the fist line can be created as follows:


Soahost=localhost
port=8001
username=weblogic
password=welcome1
ver=1.0



Please share this with your friends and collegues, comment if you already tried or successfully implemented on your SOA environment.

Video References:

Iris Li demonstrates how to deploy a SOA composite application using the Oracle Enterprise Manager 11g

SOA Composites references :

4 comments:

  1. I like the script , was able to use in 5 minutes, only thing I need to figure out is how to clear the error and send partition as a variable .. thanks Pavan, thumbs up for your work.


    ReplyDelete
  2. Hello Gopi,

    I wrote a script to stop and start multiple composites based on the property file.

    I am getting * at the end of the compositeDN as below

    compositeDN =default/ErrorService!2.0*

    and getting the below error

    Exception:javax.management.MBeanException: The configuration file, deployed-composites.xml, does not contain the default/ErrorService!2.0* composite element.

    when I run the script with hardcoded values it is working fine, can you please guide me on fixing this issue.

    I am not getting the * at the end of compositeDN as above, when I run with hardcoded values.

    ReplyDelete
    Replies
    1. Is THIS "ErrorServlet!2.0" you want to deploy? or something other? To avoid '*' at the end you can use rstrip Python function as :

      compositeDN ="default/ErrorService!2.0*"
      print compositeDN.rstrip('*')

      Let me know if it is helpful.

      Delete

Please write your comment here

Popular Posts