Sunday, April 19, 2020

Oracle Service Bus 12C REST Example from Scratch – PART 2

In the previous part we understood how to set up OSB environment. In this Demo I will explain how to create a REST OSB Proxy Service and Business Service.

Now as the JDEVELOPER Studio Edition Version 12.2.1.4.0 and OSB Version 12.2.1.4.0 has been setup, I will first create a Business Service. For this DEMO I am not using any WADL, instead I will try to consume a REST API already available – http://dummy.restapiexample.com/create

 Step1: Click FileàNew ApplicationàService Bus TieràService Bus Application with Service Bus Project (I have provide the name of Application as Practice and Project as RestDemo)



Step2: Open the composite. Drag the REST Adapter to the External Services. Give name as DummyRESTBS. Follow the screenshots below





Step3: Generate a pipeline to connect to BusinessService. From the image above you can find a WADL was already generated by OSB while creating the Business Service. Follow the steps below and ensure that the pipeline is exposed as a Proxy Service














Step4: Connect Pipeline with the BusinessService











Step5: Right Click on the ProxyService and click RUN. This will open the Test Console for the proxy in the OSB integrated server. From the API the following use the below payload for testing
{"name":"test","salary":"123","age":"23"}



Saturday, March 28, 2020

Jdeveloper Studio Edition Version 12.2.1.4.0 - REST ADAPTER ERROR FIX


If you get rror while using REST adapter– SOA 12.2.1.4 JDeveloper Error: NoClassDefFoundError com/fasterxml/jackson/core/JsonFactory


The following steps needs to be performed –

Download Bundle Patch Patch 30482761: SOA 12.2.1.4 JDeveloper Error: NoClassDefFoundError com/fasterxml/jackson/core/JsonFactory from Oracle Support and Unzip to your local
1.                   Open cmd in admin mode and follow the instructions as below
a.                   cd C:\Oracle\Middleware\Oracle_Home\OPatch
b.                   C:\Oracle\Middleware\Oracle_Home\OPatch>
SET ORACLE_HOME=C:\Oracle\Middleware\Oracle_Home
c.                   C:\Oracle\Middleware\Oracle_Home\OPatch>
SET PATH=%PATH%;C:\Oracle\Middleware\Oracle_Home\OPatch
d.                   C:\Oracle\Middleware\Oracle_Home\OPatch>cd C:\Users\dhiresh.kavi\Downloads\30482761
e.                   C:\Users\dhiresh.kavi\Downloads\30482761>opatch apply

[Oracle Interim Patch Installer version 13.9.4.2.1
Copyright (c) 2020, Oracle Corporation.  All rights reserved.
Oracle Home       : C:\Oracle\Middleware\Oracle_Home

Central Inventory : C:\Program Files\Oracle\Inventory
   from           :
OPatch version    : 13.9.4.2.1
OUI version       : 13.9.4.0.0
Log file location : C:\Oracle\Middleware\Oracle_Home\cfgtoollogs\opatch\opatch2020-03-29_00-50-26AM_1.log

OPatch detects the Middleware Home as "C:\Oracle\Middleware\Oracle_Home"
Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   30482761
Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = 'C:\Oracle\Middleware\Oracle_Home')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '30482761' to OH 'C:\Oracle\Middleware\Oracle_Home'
Patching component oracle.soacommon.plugins, 12.2.1.4.0...
Patch 30482761 successfully applied.
Log file location: C:\Oracle\Middleware\Oracle_Home\cfgtoollogs\opatch\opatch2020-03-29_00-50-26AM_1.log
OPatch succeeded.]

  
   3.  cd C:\Oracle\Middleware\Oracle_Home\jdeveloper\jdev\bin --> run -jdev clean 

Thursday, March 26, 2020

Oracle Service Bus 12C REST Example from Scratch – PART 1


SETTING UP LOCAL OSB 12C ENVIRONMENT VIA JDEVELOPER INSTALLATION
Step 1: Download SOA Suite from here
Step 2: Download Java SE Development Kit 8u241 from here
Step 3: Install Java
Step 4: Run cmd as Administrator
à cd to Jdk bin location à C:\Program Files\Java\jdk1.8.0_241\bin>java -jar C:\swdownloads\fmw_12.2.1.4.0_soa_quickstart.jar
Follow instructions and keep clicking Next. Jdeveloper will be installed with SOA SUITE 12C and OSB 12C


Step 5: Follow the sub steps below to Start Integrated Server

  1. Open JDeveloper Console click RUNàClick Start Server Instance
  2. Provide username and password. Keep weblogic and welcome1. Don’t change any port and Click Next
  3. You will start seeing the below messages -  
    #################################################[Waiting for the domain to finish building...]
    [12:35:36 PM] Creating IntegratedWebLogicServer Domain...
    [12:38:11 PM] Extending IntegratedWebLogicServer Domain...
    [12:39:51 PM] Extending IntegratedWebLogicServer Domain...
    [12:41:06 PM] Extending IntegratedWebLogicServer Domain...
    [12:42:55 PM] IntegratedWebLogicServer Domain processing completed successfully.
    *** Using HTTP port 7101 ***
    *** SSL port conflict detected.  The SSL port will be reassigned to port 7104. ***
    C:\Users\dhiresh.kavi\AppData\Roaming\JDeveloper\system12.2.1.4.42.190911.2248\DefaultDomain\bin\startWebLogic.cmd
    [Starting IntegratedWebLogicServer.]
    [waiting for the server to complete its initialization...] Depending on the system specifications, you will something like this
    [IntegratedWebLogicServer startup time: 420989 ms.
    [IntegratedWebLogicServer started.]
    **** Due to port conflicts, the server is configured at Listen port 7101, SSL port 7104.]#############
  4. You can open the EM Console using this URL: http://127.0.0.1:7101/em/
    Weblogic Console using this URL: http://127.0.0.1:7101/console/
    Service Bus Console using this URL:
    http://127.0.0.1:7101/servicebus/

Tuesday, March 24, 2020

SOA CS ADAPTERS - JMS

JMS ADAPTERS - Creating Weblogic Resources


JMS (Java Messaging Service) Adapter is based on JCA architecture (J2ee Connector Architecture) also known as Binding components. It can be used either as Inbound (receive message) or external (publish message).
Adapters basic helps converts native data to web services format to be used by composite. Conversion is done using JCA API, packaged as .rar file deployed in WebLogic server which is available during the runtime of a composite.


It falls under category of Technology Adapters. This can be used by both Oracle SOA Suite and Oracle Service Bus.
JMS is Java Messaging Server Application which runs of Application Servers as WebLogic provides JMS messaging infrastructure two mechanisms for message exchange –
  • Point to Point (Queue)
  • Publisher Subscribers (Topic)
This acts as a bi-directional adapter which allows messages to be published both (inbound and outbound)


JMS Adapter Configuration

  1. Login to SOA CS instanceàClick Managed Service IconàClick WebLogic Administrative Console.
  2. Login to WebLogic Admin ConsoleàExpand Domain Structure Panelà ServicesàMessagingàJMS Modules
  3. Click Lock and Edit Button. We can either create a new JMS module or create a new infrastructure under an existing module like SOAJMSModule. Click this module
  4. Click Newà Select Queue àClick NextàProvide Name and JNDI Name as TestQueue1 and jms/TestQueue1. Click Finish. The Queue is now created
  5. Click QueueàClick Subdeploymentà(Target to SOA JMS Server)
  6. Click NewàSelect Connection FactoryàClick NextàProvide Name and JNDI Name as TestCF1 and jms/TestCF1. Click Finish. The Connection Factory is now created
  7. Click ConnectionFactoryàClick Subdeploymentà(Target to SOA JMS Server)
  8. Expand Domain Structure Panelà Deploymentsà JmsAdapteràClick ConfigurationàClick Outbound Connection PoolàSelect Existing Connection FactoryàClick newàGive JNDI Name of ConnectionPool as eis/TestQueue1. Save the deployment plan as JMSAdapterPlan.xml
  9. Go Back to the ConnectionFactory created in Step8. Click the above JNDIàProvide ConnectionFactory created in Step 6 in the ConnectionFactoryLocation field, Click Save. Finally activate changes.
  10. Click Lock and Edit. Expand Domain Structure Panelà Deploymentsà Navigate to JMS AdapteràClick JMS AdapteràClick Update Button, Click the option having the deployment plan created in Step8

Tuesday, March 17, 2020

SOA CS Instance Provisioning

1.       Login to Oracle Cloud and Browse till classic infrastructure
a.       Once you login – the logged in cloud url will be https://console.#####.oraclecloud.com/
b.       Browse to Profile àService User Console
c.       You will enter a similar URL - ttps://myservices-cacct-####.console.oraclecloud.com/mycloud/cloudportal/cloudHome
d.       Click à Select classic infrastructure
2.       Create pre-requisites before provisioning Oracle SOA Cloud Service:
a.       Create Storage Backups for DB and SOA
                                                               i.      Click Top Left Navigation Menu à Storage ClassicàCreate ContaineràGive name (DBBackUp)
                                                             ii.      Click Top Left Navigation Menu à Storage ClassicàCreate ContaineràGive name (SOABackUp)
3.       Create Database Cloud Instance and SOA Cloud Instance
a.       Create Database Cloud Instance:
                                                               i.      Click Top Left Navigation Menu àDatabase ClassicàCreate Instance
                                                             ii.      Provide Instance Name(SOACSEEDB<UserName>) and other details as per Oracle Standards and generate the SSH Key. Download and save it to your local system.  The DB instance is now created. Provision time for this instance is almost 30 mins .
b.       Create SOA Cloud instance:
                                                               i.       Click Top Left Navigation Menu àSOA
                                                             ii.      GiveDetails. Give details of Database instance previously created and can use the public key previously generate. Provide details as per Oracle Standards and Business Needs. The SOA instance is created after 60mins.

Sunday, March 1, 2020

Retry using OIC

How to add retry logic in OIC


In a regular JCA adapter, there are properties for setting the number of retries.  

OIC as of now doesn’t allow retry options for Synchronous service but it does allow retry options in Asynchronous service.

In Asynchronous service the errors can be resubmitted. As per OIC documentation
Resubmitting the failed instances can be done as 
§  Single failed message resubmissions
§  Bulk failed message resubmissions


Retry can be done at integration level as well. I am providing the steps below which can be applied to the integration. This example is for SOAP Trigger. Ensure that Trigger has optional element as a RetryCounter-

Step 1: Create Integration. Create a Stage and drag an Invoke (example an external SOAP service). 
Step 2: Create an Invoke Connection with URL and Security details from integration created in Step1.  
Step 3: Set the retry counter value in OIC LookUp
Step 4: In Stage Error Handler create a SwitchCase, drag the above connection and map parameters from the main flow. 
Step 5: In the switch condition, the retry counter value should be less than the LookUp value created in Step3. 
Step 6: In Case 1 – Update the retry counter, In Case2 – Invoke the connection created in Step2. 

FBDI Introduction

FBDI  stands for File Based Data Import. It is a pattern provided by Oracle to have the data loaded into Oracle ERP Cloud. Its usually u...