Thursday, October 17, 2019

12c OSB - poll file from local directory using file transport

Here We will poll the file from local read directory using file transport.
Create OSB project and also create three folders in your local Directory (1. Read 2. Stage 3. Error).
 Select service bus project.
 Provide project name and click finish.
Right click on Proxy Services swim lane and select file transport.

 Click next and select messaging.
Select request text and response None, because file transport one way service.

Provide endpoint path.
 Service created.
 To resolve above proxy error, Double click proxy service and go to the transport details.
Give stage and error path here
 Save the project, now error is resolved after providing the stage and error path.
Copy the file in read path and test, after testing file will automatically poll.

12c OSB - Create business service using DB package and procedure

Drag and drop db adapter in external service
 Select the DB connection. If it is not created, create it using the pencil button.
 Select "call a Stored Procedure or function" option.
 Select the schema
 Select the package and procedure under that schema

 Right click on a folder⇾Service Bus⇾Generate Business Service
 Choose the created JCA  DB adapter

Click Finish

Wednesday, October 16, 2019

12c OSB Throttling

What is Throttling:
Throttling is termed as "regulate the flow". Oracle Service Bus has throttling feature and by using that feature we can control number of requests sent to target service.

Why we need OSB throttling:
Every system has its own capacity means it can process only certain number of message at one time, if we try to send messages beyond its capacity then that system's performance can degrade or in worst case it can crash. So to avoid all this we can use OSB throttling feature to send limited messages to target system.

In oracle Service bus we have two approaches to resolve these kind of errors:
  • Throttling in Business Services
  • Work Managers
By using throttling in business service we can restrict the no of requests to target system.

Here I will show the Throttling setups in Business Service.
  1. Create a Service bus application, project, proxy schema, WSDL and Proxy service.
  2. Create Business Service
  3. Create the XQUERY mapping for request response.
  4. Service callout to the created business Service and mapping request response
  5. Setup the throttling from EM console.
  6. Load test from SOAP UI tool.
Create a Service bus project, proxy schema, wsdl and Proxy service.
Click here 12c-osb-create-wsdl-proxy to know how to create service bus project, proxy wsdl and proxy service.

I have created a SOA hello World service which i will call as business wrapper service.
Create business service

Create XQUERY mapping files:

Same way create the response mapping

Service callout to the created business service and use the created request and response mappings.

Set up the throttling settings from EM console:
EM Console⇾Target Navigation⇾SOA⇾Service-bus (AdminServer)⇾Select the service bus project⇾Go to Operations tab⇾click the business service⇾Enable throttling state and Maximum Concurrency, Throttling Queue and Time to Live values for throttling.

Maximum Concurrency: The maximum number of records that the business service can process simultaneously. This value can not be 0 (zero); it must be a positive integer.
Throttling Queue: The maximum number of messages in the Throttling Queue or Throttling Queue. A value of 0 indicates that there is no Throttling Queue.
Time to Live: The number of milliseconds that a message can be in the queue before expiration. A value of 0 means that messages do not expire.

If you no longer want to limit messages for a business service, you can disable throttling for this service at any time. When you disable throttling, the messages are processed normally and the message flow is no longer limited by the throttling settings.
To disable the throttling for a business service, uncheck the Throttling state box.

Load test from SOAP UI:
Created service bus URL:
File⇾New SOAP Project
 Put the WSDL url in the initial WSDL and give a project name
right click on the created Request⇾Add to Test case
Provide a test suite name
Provide a test case name

Right click on Load tests⇾New Load Test
Provide the Load test name
Configure the load test parameters as required. here I send 20 requests as total runs.
 You can see 3 requests hit the service at a time.

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...