Oracle SOA Suite 11g, Enable logging for EDN events


By default the logging for the events are turned off.
Connect to your DEV_SOAINFRA schema and execute :
1DECLARE
2  ENABLED NUMBER;
3BEGIN
4  ENABLED := 1;
5 
6  EDN_ENABLE_LOGGING(
7    ENABLED => ENABLED
8  );
9END;
Trigger a new business event and select the logging in the ‘EDN_LOG_MESSAGES_TABLE’ (select * from edn_log_messages)

Oracle SOA Suite 11g, Resequence messages in Mediator

“A Resequencer is used to rearrange a stream of related but out-of-sequence messages back into order. It sequences the incoming messages that arrive in a random order and then send them to the target services in an orderly manner. The sequencing is done based on the sequencing strategy selected.”
For the resequencer to work we need to have 2 values in the source payload. The first one is a sequenceID, and the next one is a groupdID. The sequenceID will be used as identifier for the message itself. The groupID will be used to group the messages in which the resequencer will rearrange the messages based on the sequenceID. Different groups will have seperate processing, so they won’t have any influence on each other.
The mediator supplies us 3 types of resequencers :
  • Standard Resequencer
  • FIFO Resequencer
  • BestEffort Resequencer
Let’s test the first one.
For this i created the next composite

In here i just map the input of the process 1on1 to the File adapter, which will store the input of the process on filesystem.
Interface of the composite
01<?xml version="1.0" encoding="UTF-8"?>
02<schema attributeFormDefault="unqualified"
03    elementFormDefault="qualified"
06    <element name="process">
07        <complexType>
08            <sequence>
09                <element name="empID" type="string"/>
10        <element name="empType" type="string"/>
11        <element name="empName" type="string"/>
12            </sequence>
13        </complexType>
14    </element>
15    <element name="processResponse">
16        <complexType>
17            <sequence>
18                <element name="result" type="string"/>
19            </sequence>
20        </complexType>
21    </element>
22</schema>

Configuration of the sequencer

Doubeclick the mediator component in the composite.

For the Resequence Level we can select ‘operations’ or ‘component’.
For Mediator components which only have 1 operation it doesn’t matter which one we select. For a Mediator component which consists of more then 1 operation and selecting the ‘component’ option means resequencing is applied to all operations in it. For this test we selected the ‘component’ option and used the ‘Standard’ mode.
Now we have several options to configurate the resequencer.
  • Group – xpath expression to the field in the payload which the resequencer will use to group our incoming messages
  • ID – xpath expression to the field which will uniquely identify our message
  • Start – Start value of the ID in the incoming message
  • Increment – Value which will be used for the increment of the id field in the upcoming messages
  • Timeout – Time to wait before a following expected message arrives at the Mediator component
And that’s it what is needed for the configuration of the ‘Standard’ resequencer.

Test

To test this scenario i will use the following 3 messages.
1<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
3                <ns1:process>
4                        <ns1:empID>1</ns1:empID>
5                        <ns1:empType>IT</ns1:empType>
6                        <ns1:empName>Eric</ns1:empName>
7        </ns1:process>
8    </soap:Body>
9</soap:Envelope>
1<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
3                <ns1:process>
4                        <ns1:empID>2</ns1:empID>
5                        <ns1:empType>IT</ns1:empType>
6                        <ns1:empName>John</ns1:empName>
7        </ns1:process>
8    </soap:Body>
9</soap:Envelope>
1<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
3                <ns1:process>
4                        <ns1:empID>3</ns1:empID>
5                        <ns1:empType>IT</ns1:empType>
6                        <ns1:empName>Theo</ns1:empName>
7        </ns1:process>
8    </soap:Body>
9</soap:Envelope>
Go to the console > soa_domain > SOA > soa-infra > > and Test it.
If we trigger the process 3 times with the payloads as we describes and in the same sequence, the instances will all complete and write the files to filesystem in the same sequence.

We used the ‘Standard’ mode and selected empID for sequence-value and emptType for group-value, and the sequence should start with 1 and will increment by 1.
Now switch the last 2 messages in the sequence and see what happens. Since we’re trying to process and already processed message again we will get the next errormessage
1The selected operation execute could not be invoked.
2An exception occured while invoking the webservice operation. Please see logs for more details.
3oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: oracle.tip.mediator.infra.exception.MediatorException: ORAMED-03003:[Storing Resequencer Group Failed]Unable to store Resequencer Group." oracle.tip.mediator.common.persistence.MediatorResequencerMessage, mediator InstanceId=E07531315F8511DFBFBF3B164F19FDA3, componentDn=default/MyReSequence!1.0/Mediator1, operation=execute, groupId=IT, sequenceId=1, status=0"Possible Fix:Unable to store Resequencer Group. Check your Database connection or check data
So change all empType to ‘HR’ instead of ‘IT’.
For example
1<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
3                <ns1:process>
4                        <ns1:empID>1</ns1:empID>
5                        <ns1:empType>HR</ns1:empType>
6                        <ns1:empName>Eric</ns1:empName>
7        </ns1:process>
8    </soap:Body>
9</soap:Envelope>
The sequence we’re now going to use is empID=1, empID=3, empID=2
After sending the second message (empID=3), you will notice the instance won’t complete. Because the resequencer expects an empID=2. In this case it will wait till this message arrives.
1<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
3                <ns1:process>
4                        <ns1:empID>2</ns1:empID>
5                        <ns1:empType>HR</ns1:empType>
6                        <ns1:empName>Eric</ns1:empName>
7        </ns1:process>
8    </soap:Body>
9</soap:Envelope>


Now use the last test message (empID=2) and see what happens.

Instance 30030 changes from Running to Completed. This is because it received the next message in the sequence (empID=2), and after that the instance 30030 (empID=3) could continue.
If we check the files on filesystem we also see (compair the datetime of the files) that the files are stored in the correct sequence.

Other Resequencers

Besides the ‘Standard’ resequencer wel also have the ‘FIFO’- and the ‘BestEffort’ resequencer.
See this document to decide what resequencer suits best for your case.

Oracle SOA Suite 11g and the new Partitions feature

In the old school Oracle SOA Suite we had the functionality to create different domains in the BPEL Console to group our applications.
This functionality was gone in the 11g SOA Suite, and because it still was a wanted feature, Oracle reintroduced it as feature in the new Oracle SOA 11g Patchset2.
Now it’s called ‘Partitions’.
So let’s see how to manage them.
Go to the Enterprise Manager (http://localhost:7001/em), Farm_ > SOA > soa-infra (soa_server1).
Right mouseclick on soa-infra > Manage Partitions. Create the new partition.





The new partition should be added to the list (beneath the default partition).
JDeveloper
In JDeveloper we will create a simple SOA Composit application.
Deploy the new application and now in the wizard of the deployment when we select a server it gives us a new selectbox to select the newly created partition. By default it will use the ‘default’ partition.

Deploy the application and let’s go back to the console.
Now we will see the new deployed application in the list of the ‘test_partition’ partition.

Using ant

ant-sca-mgmt.xml createPartition – Creates a partition in the SOA Infrastructure.
Location of the file :
1<ORACL_MIDDLEWARE_HOME>/bin
ant -f ant-sca-mgmt.xml createPartition -Dhost=localhost -Dport=8001 -Duser=weblogic -Dpassword=weblogic -Dpartition=my_ant_partition
01Buildfile: ant-sca-mgmt.xml
02     [echo] oracle.home = E:\oraclehome\11g\middleware\Oracle_SOA1\bin/..
03
04createPartition:
05    [input] skipping input as property host has already been set.
06    [input] skipping input as property port has already been set.
07    [input] skipping input as property user has already been set.
08[secure-input] skipping secure-input as property password has already been set.
09    [input] skipping input as property partition has already been set.
10     [echo] oracle.home = E:\oraclehome\11g\middleware\Oracle_SOA1\bin/..
11
12folderMgrTask:
13     [java] calling FolderManager.initConnection(), m_host=localhost, m_port=8001, m_user=weblogic
14     [java] Connecting to: service:jmx:t3://localhost:8001/jndi/weblogic.management.mbeanservers.runtime
15     [java] connection initiated
16     [java] folderMBean=oracle.soa.config:name=soa-infra,j2eeType=FolderLifecycleConfig,Application=soa-infra
17     [java] Partition (my_ant_partition) is successfully created.
18
19BUILD SUCCESSFUL
And the partitions list in the console


Weblogic

1. Managed Servers are on Admin state instead of Running state

During start up managed servers from admin console result in Admin State instead of Running State (see the screenshot below). This issue comes up usually when Weblogic is unable to connect to infrastructure database. Usually this is happening when the infrastructure database's listener is not down after reboot or server configuration change. In Windows make sure oracle services are up and the database EM console is accessible