Monday, December 23, 2013

BAM 11g- Connect to BAM Using Sensors

In previouspost we discussed about BAM adapter and how to integrate Oracle SOA Suite and BAM using BAM adapter.

In this post, we will discuss about BPEL sensor and sensor action and will see how we can use sensor and sensor actions inside BPEL to send data to BAM.
There are some prerequisites that we need to fulfill.
  • BAM server should be up and running
  • BAM server connection is there in Jdeveloper
  • BAM Data Object should be created
We created one BPEL process, for that we will create sensor and sensor actions. Below is the synchronous BPEL.


To add the required sensor and sensor actions you need to click on Monitor tab.



Sensors
Right Click on Transform and create a new sensor.
Give any name to sensor. Set evaluation time to “Completion”. Then click on green button to add variable.

You can see you choose any option from drop down.



Now we need to specify the variable from that we will fetch the values. Select output variable.

Click OK button that will add sensor to your BPEL.



Now we are done with Sensor creation, our next step will be sensor action creation.

Sensor Actions
 
To create sensor action click on Structure that will open one panel. You will be able to see “Test Sensor” in that which we created in previous step. To add sensor action right click on “Sensor Actions” Folder.
We will get two options “Sensor Action” and “BAM Sensor Action”. We will discuss both one by one.

Let’s first discuss about “Bam Sensor Action”. BAM sensor action is used we directly want to send data to BAM data object.



First Take “BAM Sensor Action”. This will open one pop-up. Give any name to sensor action. Select Data object to that we need to connect. For this you need to have BAM Connection.
Now select the operation “upsert”. It will show all the fields that are there in Data object. Choose one key field. And click on add transform button (green button). Map the values in transform.



Now we have sensor and sensor action.

Now deploy the composite on server and run that. You will able to see the values inside that data object.

Now we will discuss “Sensor Action”. Sensor action is used when we want to send data from BPEL to either JMS Queue, Database etc and then do the configuration in BAM to fetch that data from respective publish type.
Click on Sensor Action.


From Publish Type choose JMS Queue. Fill all the details for that queue.


JMS Connection Factory—weblogic.jms.ConnectionFactory (don’t specify connection factory name here .thsi value will be constant)

Check the Enable checkbox.

Friday, December 20, 2013

BAM 11g- BAM Adapter Configuration

BAM is part of Oracle Fusion Middleware stack and it is used for monitoring and reporting purpose. There are different ways to link Oracle SOA suite to BAM, one of it is BAM adapter.

In this post, we will discuss about BAM adapter and do the configuration.
BAM adapter is used to do the monitoring at composite level. When we want to monitor full message we usually use BAM adapter but for variable and activity monitoring we use Sensor and Sensor actions.

To add the BAM adapter to your composite, go to Service Adapter and choose BAM Adapter and drag it to composite.


Provide Service name and choose BAM Data Object by clicking on browse button.
Make sure BAM server connection is already there in your Jdeveloper and required BAM Data Object is already created in BAM.



Once you choose the Data Object then you need to choose the required Operation. We can choose one operation from below list.

  • Insert
  • Update
  • Delete
  • Upsert

Since we choose the upsert, so we need to choose the fields that we want to Insert + Merge in Data Object.

Now we need to configure the JNDI that we will use for BAM Adapter.

Go to admin Console. Click on Deployment.
Go to OracleBamAdapter and then click on Configuration Tab.

Open “Outbound Connection Pool” tab and expand RMI Connection factory. Click on eis/bam/rmi. Enter all the required values and clicks save. Here you need to enter BAM server details.
Make sure you update the OracleBAMAdapter in deployments once you are done with above changes.

Now we can use “eis/bam/rmi” in our Bam adapter to connect to BAM server.

Click Finish. Your BAM adapter is configured to connect to BAM server.

Oracle SOA Interview Questions and Answers (File Adapter) Part- 8

Question: What is “Minimum Age” in File adapter?
Answer: This parameter specifies the minimum age of files to be retrieved. This enables a large file to be completely copied into the input directory before it is retrieved for processing.


This is Chapter-8 of Oracle SOA interview questions and answers series.


Question: What is trigger file in File adapter?
Answer: When we choose “Trigger File” checkbox, file adapter will not poll/read the file/files from specified directory unless it sees trigger file in trigger file directory. Once trigger files is there in the trigger file directory, file adapter will start polling the files.


Question: What is Logical path in File adapter?
Answer: This parameter specifies the logical input directory to be polled. The parameter is of type String. We provide value of logical path in composite.xml file.


Question: How to handle errors when we unable to read/poll a file using file adapter if that file is corrupt?
Answer: We need to use File rejection handler to catch these types of error.


Question: What is Sync-Read in file adapter?
Answer: When we want to read a file in between our BPEL flow then we use this option.

Question: Can we read remote files using file adapter?
Answer: To read file from remote location we need to use FTP adapter.


Question: What is native format?
Answer: when we want to read the file as it, means we don’t want to transform file content to XML format then we use native format option.


Click here to go to Chapter-7                                                       Click here to go to Chapter-9










SOA 11g- Echo In Mediator

A new feature is added to Oracle SOA suite 11g for mediator, it is called Echo.


Echo option is used when we don’t have target service availlable ,we expose Mediator functioanlity as taraget service and Echo a respone to intial caller . Suppose we are doing qurey from target service but that target service is down due to some reason , in this case to test our Mediator we use Echo, we will create sample query response message and pass that to calling service as a Echo.

In this post, I will show you how we can create one sample Mediator project to show Echo functionality.

Create one project and add Mediator to it. Name it as “MediatorEcho” and made it as Synchronous.


 


Go to Mediator mplan file and open one static routing rule.
 



Choose “Echo” from available options.


Do the required mapping and map all the fields which we want to send to initial caller as Echo.





Testing Result:

Test the Mediator service by sending some sample message and in the output you should get the same message.

Thursday, December 19, 2013

Oracle Service Bus Interview question and answers Part-2

This is Chapter-2 of OSB interview questions and answers series.


Question: Can we use more than one route node in message flow?
Answer: No, we can't we use more than one route node in proxy service message flow.


Question: When we call asynchronous service from OSB then how to get response back from that asynchronous service to OSB?
Answer: Design the proxy service which in turn calls business service which in turn calls asynchronous service. In the message flow of this proxy change the message header to below.
You need to specify ReplyTo value so that asynchronous service response came to CallSyncCompositeProxy proxy service.

<soap-env:Header xmlns:ns1="http://schemas.xmlsoap.org/ws/2003/03/addressing">
<ns1:MessageID>ws:uniqueAddress</ns1:MessageID>
<ns1:ReplyTo>
<ns1:Address>http://localhost:8011/CallAsyncService/proxyServices/CallSyncCompositeProxy</ns1:Address>
</ns1:ReplyTo>

</soap-env:Header>

Remember ReplyTo address refers to CallSyncCompositeProxy endpoints.

For more details refer my below post



Question:  What is throttling in OSB?
Answer: Throttling means we want to process certain messages in one time, then we need to set some parameters in OSB to do the required task.

For more details refer my below post
http://soawork.blogspot.com/2013/01/throttling-in-osb.html

Question: to transform from binary to XML or XML to binary format what we will in OSB?
Answer: we use MFL.


Question: can we use MDS in OSB?
Answer: No, Oracle Service Bus does not support MDS.

Question: Can we use DVM’s in Oracle Service Bus?
Answer: No, we can’t use DVM’s in Oracle Service Bus.




Click here to go to Chapter-1                                                       Click here to go to Chapter-3


Wednesday, December 18, 2013

Oracle Service Bus Interview Question and Answers Part - 1

This is Chapter-1 of OSB interview questions and answers series.


Question: To connect to source system which service we will use?
Answer: we will use Proxy service to connect to Source system.


Question: To connect to target system which service we will use?
Answer: we will use Business service to connect to target system.

Question:  What is Proxy Service?
Answer: It is a service in OSB which is exposed to source system or application.


Question: What is Business Service?

Answer: It is a service in OSB which is used to connect to target system.


Question: What is Message Flow?
Answer: Message flow is there in proxy service, We do all types of transformation, routing and other processing message flow only.

Question: Do we have global variable in OSB (Can we access variable which is defined in proxy service message flow from other proxy service message flow)?
Answer: No, we can't access variable in proxy service message flow from other proxy service message flow.

Question: Can we use direct bindings to call SOA composites?
Answer: Yes, we can direct binding-bindings to call SOA composites along with SOAP bindings.

Question: Where the file will go if there is any error while polling the file ?
Answer: During configuring file or ftp protocol in OSB, we need to specify error directory, so you can see file to that directory if file polling failed.

Question: Why we use Split-Joins in OSB?
Answer: To do parallel processing.

Question: Types of Split-Joins?
Answer: Static and dynamic.

Question: How to call Java code from OSB?
Answer: By using Java callout activity.





Click here to see Chapter-2 of this series


SOA 11g - Trigger File In File Adapter

By default when we poll the file using file adapter, it starts reading the file as soon as we deployed our composite to server. To get more control over it we can use trigger file option available in file adapter.

When we choose “Trigger File” checkbox, file adapter will not poll/read the file/files from specified directory unless it see trigger file in trigger file directory. Once trigger files is there in the trigger file directory, file adapter will start polling the files.

Suppose we have one business scenario, we should not poll/read the files which contain information regarding student unless source system writes all the files to required location. We will use trigger file option available to handle this scenario and polling will only start when source system writes all the files to specified location and put one trigger file to trigger file directory in the end.

To add File adapter to your composite, choose “File Adapter” from service adapters and drag it to the composite.

Choose “Read” operation as we will poll/read the file.



Specify polling file directory and check "Delete files after successful retrieval" if you want to delete the file after reading.
Set the polling frequency.


Check the “Trigger File” option. The trigger file directory can be the same as the inbound polling directory or different from the inbound polling directory. However, if your trigger file directory and the inbound polling directory are the same, then you should ensure that the name of the trigger file is not similar to the polling file.
If you want to use different directory for trigger file then don’t check the “Use directory for incoming files” checkbox and provide trigger directory and file name.




If you want to use same directory for trigger file then check “Use directory for incoming files” checkbox and provide trigger file name.
 
Browse required schema and choose schema element.
 
Testing Results:
Source system wrote Student.xml file to specified directory but polling didn’t start yet because trigger file is not there.
Once source system place trigger file to specified directory.
 
Once trigger file is placed in specified directory, file adapter will poll the Student.xml file and process it.



Friday, December 13, 2013

SOA 11g- Master and Detail process coordination using signals

We usually came across many scenarios where we need to coordinate between Master and Detail (Child) process to achieve our objective.
In new version of SOA, Signal activity is introduced which helps us to coordinate between Master and Detail process.
Let’s talk about one business scenario where we need to coordinate between Master and Detail process i.e. where we need to use Signal activity in BPEL.
Suppose a customer is booking a flight through airline website, customer will choose date, destination & boarding location etc then finally make the payment to book that flight. In this case date, location etc information will go to airline and airline needs to validate customer credit card or other mode of payment from bank. Here airline will first send credit card information to Bank but first it needs to validate date, destination & other information, once it is validated then airline send message to Bank that verify credit card information and meanwhile airline will wait for the response from Bank unless it receive any response from Bank, it will not start further processing. Once response is received from Bank, airline will do the rest of processing and after that response Bank can complete their processing.
Potential coordination points are as follows:
·         The master process (Airline) must signal the detail processes (Bank) that airline validation is successful and to continue processing.
·         Detail process (Bank) must signal the master process (Airline) after credit card validation is complete.


In This post, I will show how we can implement above business scenario in SOA (BPEL).
Create Details process (Bank). In this post I will refre Detail process as Child process.
 

Made it as one way process and add receive signal activity after receive activity. Name it as “RecieveSignalFromMaster” and put label as “PrimarySignal” and choose master from drop down list.
<bpelx:receiveSignal name="ReceieveSignalFromMaster" label="PrimarySignal" from="master"/>


Add wait activity and then add Signal activity to send signal back to Master.
<wait name="WaitFor1min" for="'PT1M'"/>
 <empty name="DoSomeworkhere"/>
<bpelx:signal name="Signal_SendBackToMaster" label="SecondarySignal"  to="master"/>


Complete Child Process flow.


Now Create Master process (Airline). Make it one way process.

Now we need to invoke Child process from master process. So add child process WSDL and Schema file in Master process and create Child process partner link.
Don’t forgot to click “Invoke as Detail” checkbox

Add Signal activity to send signal to child process.
<bpelx:signal name="Signal_SendToChild" label="PrimarySignal" to="details"/>
Add Receive Signal activity to receive signal from Child process
<bpelx:receiveSignal name="receiveSignalFromChild" label="SecondarySignal"                         from="details"/>
 Complete flow of Master process
  
Testing Result







Friday, November 22, 2013

SOA 11g - BPEL Performance Tuning Parameters

This post shows some properties which we can be set inside our composite which impact the performance.

·         inMemoryOptimization
This property indicates to Oracle BPEL Server that this process is a transient process and dehydration of the instance is not required. When set to True, the completionPersistPolicy is used to determine persistence behavior. This property can only be set to True for transient processes or processes that do not contain any dehydration points such as receive, wait, onMessage and onAlarm activities. The inMemoryOptimization property is set at the BPEL component level. When set to True, dehydration is disabled which can improve performance in some use cases.
Values:

This property has the following values:
False (default): instances are persisted completely and recorded in the dehydration store database.
True: The completionPersist policy is used to determine persistence behavior.
·         completionPersistPolicy
This property configures how the instance data is saved. It can only be set at the BPEL component level. The completionPersistPolicy property can only be used when inMemoryOptimization is set to be True (transient processes). Note that this parameter may affect database growth and throughput (due to reduced I/O).
Value
Description
On (default)
The completed instance is saved normally.
Deferred
The completed instance is saved, but with a different thread and in another transaction.
Faulted
Only the faulted instances are saved.
Note: When an unhandled fault occurs, regardless of these flags, audit information of the instance is persisted within cube_instance table.
Off
No instances of this process are saved.
<component name="BPELProcess">
 <implementation.bpel src="BPELProcess.bpel" />
 <property name="bpel.config.completionPersistPolicy">faulted</property>
 <property name="bpel.config.inMemoryOptimization">true</property>
   ...
</component>
·         auditLevel
You can set the audit level for a BPEL process service component. This setting takes precedence over audit level settings at the SOA Infrastructure, service engine, and SOA composite application levels.
Set the bpel.config.auditLevel property to an appropriate value in the composite.xml file of your SOA project as shown in the example below:
<component name="BPELProcess">
<implementation.bpel src="BPELProcess.bpel" />
<property name="bpel.config.auditLevel">Off</property>
</component>
Value
Description
Inherit
Inherits the audit level from infrastructure level.
Off
No audit events (activity execution information) are persisted and no logging is performed; this can result in a slight performance boost for processing instances.
Minimal
All events are logged; however, no audit details (variable content) are logged.
Error
Logs only serious problems that require immediate attention from the administrator and are not caused by a bug in the product. Using this level can help performance.
Production
All events are logged. The audit details for assign activities are not logged; the details for all other activities are logged.
Development
All events are logged; all audit details for all activities are logged.
·         bpel.config.oneWayDeliveryPolicy
The oneWayDeliveryPolicy property controls database persistence of messages entering Oracle BPEL Server. By default, incoming requests are saved in the delivery service database table dlv_message. These requests are later acquired by Oracle BPEL Server worker threads and delivered to the targeted BPEL process. This property persist delivery messages and is applicable to durable processes.

When setting the oneWayDeliveryPolicy property to async.cache, One-way invocation messages are stored in the delivery cache until delivered and if the rate at which one-way messages arrive is much higher than the rate at which Oracle BPEL Server delivers them, or if the server fails, messages may be lost. In addition, the system can become overloaded (messages become backlogged in the scheduled queue) and you may receive out-of-memory errors. Consult your own use case scenarios to determine if this setting is appropriate.

Value
Description
async.persist (Default)
Delivery messages are persisted in the database. With this setting, reliability is obtained with some performance impact on the database. In some cases, overall system performance can be impacted.
async.cache
Incoming delivery messages are kept only in the in-memory cache. If performance is preferred over reliability, this setting should be considered.
sync
Directs Oracle BPEL Server to bypass the scheduling of messages in the invoke queue, and invokes the BPEL instance synchronously. In some cases this setting can improve database performance.
Refernce: Oracle SOA Performance Tuning Guide