In the previous exercise we tried to install the MFT .
In this exercise we will try to create an end to end sample in MFT and will understand how it can be used to transfer file from one location to other.
Verify whether the MFT server is up or running
Since MFT server is running on 7004 port try to open the MFT console with following URL
http://localhost:7004/mftconsole
You will get a screen like this.
Now once we have got this screen we will start creating our first sample process in MFT to trasfer file from one location to another.
Switch to the Design tab of the MFT
Oracle MFT is an additonal product that gets installed on top of soa server. It helps to gain control over the exchanges of data between two different system and it also resolves the problem caused by the uncontrolled proliferation of FTP Servers.
To get a working sample for MFT ,First of all create two folder structure one for source and other for target in your local machine.
Go to DEsing page of MFT
Click on Sources and then click on the +sign as shown to create a new source.
Give it a logical name and provide type as file
In the folder location specify the location which you have created for the source
Once a source is created you can acutally see the details for the Source.
there are some additional parameters that you can add for the sources like polling frequency, minimum file , action and additional parameters.
In a similar way create a target and point it to the target directory
In a similar way target side also allows you specify some additional parameters for the targets
Now create a transfer from local source to local target
Now in the transfer page
Select your Localsource as the source system
and select your LocalTarget as the target system.
Once the source and target is selected Deploy the agreement as shown
Once it is deployed successfully to start an instance copy a file in the source folder
Now go to the monitoring tab and click on the Transfer instance you can see one of the record has been processed successfully.
You can also validate in the target folder if the file is copied.
This wasn't a great exmaple for MFT as a lot more can be achieved but just to show the functionality i have used this sample as i always believe in first creating a simple scenario before going ahead with a complex one.
The views expressed on this blog are my own and do not necessarily reflect the views of any Organisations owning these products.I keep on doing R & D with different products in and around Middle ware stack and these posts are result of that.Most of the post are result of my own experiments or ideas taken from other blogs .If in any case You feel content is not right you can comment to remove that post. This blog uses the default features,cookies of blogspot.com
Thursday, July 24, 2014
Install Manage File Transfer (MFT) for SOA 12c
Download the MFT from OTN and extract it to a folder.
Next open a command prompt and move till jdk/bin directory.
From there run the jar file for MFT
a new gui will come up as shown below
select the middleware home where you have installed SOA 12c
further we need to install RCU before we create a domain for MFT
CREATE RCU FOR MFT
Open a command prompt
and navigate to the following directory
C:\Oracle\Middleware\Oracle_Home\oracle_common\bin
and run RCU.bat
Domain Creation
Create a new domain
Go to following location
C:\Oracle\Middleware\Oracle_Home\mft\common\bin
And run config.cmd
Next open a command prompt and move till jdk/bin directory.
From there run the jar file for MFT
a new gui will come up as shown below
select the middleware home where you have installed SOA 12c
further we need to install RCU before we create a domain for MFT
CREATE RCU FOR MFT
Open a command prompt
and navigate to the following directory
C:\Oracle\Middleware\Oracle_Home\oracle_common\bin
and run RCU.bat
Domain Creation
Create a new domain
Go to following location
C:\Oracle\Middleware\Oracle_Home\mft\common\bin
And run config.cmd
Monday, July 21, 2014
Testing the Coherence Adapter in SOA 12c
In the previous exercise we saw how we can create jndi connection for coherence adapter. In this exercise we will see how we can create a sample process to test the functionality of coherence adapter.
The functionality we are going to use here is that we will use a DB adapter and based on a unique employeeID we will try to get the employee name from database. The coherence will come into the picture when we will need to retrieve the employee name for employee id which we have already retrieved. Since we are using coherence cache, the second time if we make a call to our web service to retrieve employee name for the same employeeId it should not make a db call instead it should get the result from cache, thus it will save a lot of time for the end user. Again a point to be noted is that coherence is good for those data which are historical and are not supposed to be changed, if the data is supposed to changed frequently then coherence might not provide the best solution as the assumption here is that once we have retrieved a data it will stored in cache that is we are assuming that the data will not further change. So it is important to get the business clarification on the data then only one should go ahead with coherence.
the process we are going to define will look something like this
and the composite will look something like this
Lets start designing this process and test the functionality,
First of all drag and drop a BPEL process in the composite, make it a synchronous process.
give it some logical name and let the other things be default
Next is drag and drop a db adapter and try to pull data from employee table based on the employee id information
I am using the HR Schema and trying to pull data from employees table
Again i am using a parameter so that we can pass the input from web service and retrieve the data based on this parameter from the employees table. Check out the query getting generated
Link your DB Adapter to the BPEL process and then drag and drop a coherence adapter in the External reference pane. We will be using two coherence adapter one to put the data in to the coherence and the other one to retrive it from the Cache.
provide the jndi that you have created in the last exercise(previous post)
select operation as put
in the next step specify the name of the Cache which you have defined in the last exercise(previous post).
Further deselect the option of auto generate key as we are going to pass it on run time as a header variable from soa process
Select the schema of the bpel process and then select the response document as shown below
Similarly put another Coherence adapter for retrieving the data from the cache
use the same jndi however choose get as operation this time
Again use the cache type as XML , provide the cache name and Make key type as string, left the key field blank we will pass it on run time from soa header
Again select the schema of BPEL process and select the response type the same one we have selected in the previous coherence adapter.Link both the adapter to the BPEL process
Now drag and drop an invoke activity and call the GetCacheData.Create an input and output variable for the adapter. This is done immediately after the receive activity as we will have a check on the output result from the cache.If the data is available in cache we will use the same as output otherwise we will call the db adapter and then store the result in the cache
Now go to the properties tab of the adapter and assign the input variable of the BPEL process to the header variable jca.coherence.key as shown below
Now put an assign activity this activity will just assign the input variable of the BPEL to the input of DB adapter. AFter the assign activity put an if condition. This is the place where we will check if there is data in the cache.The If condition will have the following entry. As can be seen it is checking if the output from calling coherence adapter is null or not.If it is null then call the db adapter and store the data in cache.If it is not null then simply pass the same output to the output variable of BPEL
Now we will first configure the else block
First of all we will call the db adapter to get the response from the database based on the employeeID.
Next is we will use an assign activity.
In this assign activity we will first assing the output from Database to the output variable and then we will assign this output variable to the input variable of CahceStore adapter.
Immediately we will use a cache adapater to insert the result that we have received in the previous step to be stored in cache.
We will again pass the key as a header variable as we have passed earlier
Now in the if block we will assing the output data from the GetCacheData to the output of the BPEL
NOw the process is complete,Deploy the process to the integrated server and test it.
The flow will take the else block since this is a first time invocation. It will call the db and get the result and at the same time it will store the result in cache.
The flow in this case will be as shown
Expanding the process you will find that the data is getting stored in the cache with a unique key value
Now once the process is invoked lets again call the same process with same input and you will find that the response is same however the flow is now different
Now if you will go to the flow of the second process you will find that it is actually retrieving the data from the cache
The functionality we are going to use here is that we will use a DB adapter and based on a unique employeeID we will try to get the employee name from database. The coherence will come into the picture when we will need to retrieve the employee name for employee id which we have already retrieved. Since we are using coherence cache, the second time if we make a call to our web service to retrieve employee name for the same employeeId it should not make a db call instead it should get the result from cache, thus it will save a lot of time for the end user. Again a point to be noted is that coherence is good for those data which are historical and are not supposed to be changed, if the data is supposed to changed frequently then coherence might not provide the best solution as the assumption here is that once we have retrieved a data it will stored in cache that is we are assuming that the data will not further change. So it is important to get the business clarification on the data then only one should go ahead with coherence.
the process we are going to define will look something like this
and the composite will look something like this
Lets start designing this process and test the functionality,
First of all drag and drop a BPEL process in the composite, make it a synchronous process.
give it some logical name and let the other things be default
Next is drag and drop a db adapter and try to pull data from employee table based on the employee id information
I am using the HR Schema and trying to pull data from employees table
Again i am using a parameter so that we can pass the input from web service and retrieve the data based on this parameter from the employees table. Check out the query getting generated
Link your DB Adapter to the BPEL process and then drag and drop a coherence adapter in the External reference pane. We will be using two coherence adapter one to put the data in to the coherence and the other one to retrive it from the Cache.
provide the jndi that you have created in the last exercise(previous post)
select operation as put
in the next step specify the name of the Cache which you have defined in the last exercise(previous post).
Further deselect the option of auto generate key as we are going to pass it on run time as a header variable from soa process
Select the schema of the bpel process and then select the response document as shown below
Similarly put another Coherence adapter for retrieving the data from the cache
use the same jndi however choose get as operation this time
Again use the cache type as XML , provide the cache name and Make key type as string, left the key field blank we will pass it on run time from soa header
Again select the schema of BPEL process and select the response type the same one we have selected in the previous coherence adapter.Link both the adapter to the BPEL process
Now drag and drop an invoke activity and call the GetCacheData.Create an input and output variable for the adapter. This is done immediately after the receive activity as we will have a check on the output result from the cache.If the data is available in cache we will use the same as output otherwise we will call the db adapter and then store the result in the cache
Now go to the properties tab of the adapter and assign the input variable of the BPEL process to the header variable jca.coherence.key as shown below
Now put an assign activity this activity will just assign the input variable of the BPEL to the input of DB adapter. AFter the assign activity put an if condition. This is the place where we will check if there is data in the cache.The If condition will have the following entry. As can be seen it is checking if the output from calling coherence adapter is null or not.If it is null then call the db adapter and store the data in cache.If it is not null then simply pass the same output to the output variable of BPEL
Now we will first configure the else block
First of all we will call the db adapter to get the response from the database based on the employeeID.
Next is we will use an assign activity.
In this assign activity we will first assing the output from Database to the output variable and then we will assign this output variable to the input variable of CahceStore adapter.
Immediately we will use a cache adapater to insert the result that we have received in the previous step to be stored in cache.
We will again pass the key as a header variable as we have passed earlier
Now in the if block we will assing the output data from the GetCacheData to the output of the BPEL
NOw the process is complete,Deploy the process to the integrated server and test it.
The flow will take the else block since this is a first time invocation. It will call the db and get the result and at the same time it will store the result in cache.
The flow in this case will be as shown
Expanding the process you will find that the data is getting stored in the cache with a unique key value
Now once the process is invoked lets again call the same process with same input and you will find that the response is same however the flow is now different
Now if you will go to the flow of the second process you will find that it is actually retrieving the data from the cache