OIC - Publish to OIC - Publish and Subscribe to Oracle Integration - Part-1

 
Publish to OIC

Introduction

Publish/subscribe or the pub/sub messaging is an a synchronous communication architecture

 

In a pub/sub model, any message published to a topic is immediately received by all of the subscribers to the topic. 

 

Publisher publish a message and all the subscribers subscribes to a publisher.

Oracle Integration provides a simple and managed solution for pub/sub communication. OIC provides “ICS Messaging Service Adapter” with quick configuration to achieve the objective.

 

And integrations that enable subscribers to subscribe to messages from Oracle Integration.

 

I will explain here with simple steps to build integrations that enable us to publish messages to Oracle Integration and as well subscribe to OIC

 

We will create 3 integrations

 

  •      Publish to OIC in this article 
  •      First Subscribe to OIC for FTP File creation
  •      2nd Subscribe to OIC Database Insert on-premise database


Publish to OIC will be a simple rest end point to push message to OIC. And IC Messaging service will take care of the rest.

Subscribe to OIC integrations which will use above Push integration and received the payload and consume respectively

 

Lets Implement Pub/Sub Integration in 3 Steps

1. Create a REST Connection

We will use a REST request as the Publisher.
 

Create a simple REST connection with trigger role

 From the connections under the Integration home page, click create

Connections

Creating connection - selecting adapter


REST connection

 

2.  Create an Integration.


From the Integrations, under the Integration home page, click create


We will select the Type Publish To OIC, which has the required structure ready.

Integration style

Enter the basic integration details

 

create new integration

Configure the REST endpoint details.

REST endpoint - Basic info


Select method as PUT and specify the rest document

REST Endpoint - Resource Configuration


select the Payload type as JSON and select <<<<inline>>>>

RESTT Endpoint - Request

{
  "PartyNumber" : "67895432541",
  "OrganizationName" : "CustomerA",
  "PartyUsageCode" : "EXTERNAL_LEGAL_ENTITY",
  "RawPhoneNumber" : "9199199199",
  "EmailAddress" : "bm@oracle.com",
  "URL" : "www.oracle.com",
  "Address" : [ {
    "AddressType" : "BILL_TO",
    "Address1" : "500 Oracle Parkway",
    "City" : "Redwood Shores",
    "Country" : "US",
    "County" : "San Mateo",
    "PostalCode" : "94065",
    "PostalPlus4Code" : "",
    "State" : "CA"
  } ],
  "CorpCurrencyCode" : "USD",
  "CurcyConvRateType" : "Corporate",
  "CurrencyCode" : "USD",
  "DUNSNumber" : "123456789"
}


Copy above sample JSON sample payload and put as below screen


Enter sample JSON

Review and Click Done.

REST Endpoint - Summary

Integration is done. You will see the integration as bellow.

REST connection is at the left side and automatically configured to IC Messaging Service

No need further configuration or any mapping

Just close and come back to main integrations grid.

integration grid

3. Activate Integration

Now lets activate it. select Enable tracing and include payload and select Activate  

Activating Integration


Our Push to OIC integration is completed.

In next step, we will create 2 simple Subscribe to OIC integrations which will use above Push integration and received the payload and consume respectively

In this 2nd article we will create one Subscribe to OIC integration for FTP file creation


In 3rd article we will create 2nd Subscribe to OIC integration for inserting same data in a database table, for this we will use OIC Agent to connect to on premises EBS database


Thank for reaching to my blog. for further information please visit below oracle library 



OIC - Subscribe to OIC - FTP file Creation - Publish and Subscribe to Oracle Integration Cloud - Part-2


Subscribe to OIC

Introduction

In the first blog we created a Push to OIC integration, in this blog we are going to create 2 more Subscribed to OIC integrations


In this blog  we will create Subscribe to OIC integration to consume payload and create a csv file on FTP location


Push to OIC - Publish and Subscribe to Oracle Integration - Part-1


Integration to FTP


in this integration, we will subscribe to the Push integration and consume it by creating a simple file on FTP location. To do that we need a FTP connection and a Sub Integrations


1. Create a FTP Connection
 

Create a FTP connection 


From the connections under the Integration home page, click create 


Connections


Search FTP


Selecting Adapter
Set the FTP connection properties

Connections Details 
Connection Details


Credentials Details as below screen shot

Credential Details
2.  Create an Integration.


From the Integrations, under the Integration home page, click create


We will select the Type Subscribe To OIC, which has the required structure ready.



Integration Style

Enter the basic integration details

Create new integration

In Subscribe to OIC pattern, when you click create button, OIC will ask to select the publisher. Remember to select the publisher that we created in previous blog 

Select Use

Selecting Publisher

You will now land to the below screen. We need to add the FTP connection that we created earlier.

Search in right panel and drag and drop to right side what I mark the arrow.


Integration


When drop the FTP connection, it will ask the file creation details provide the details as below screen shot

End point - basic info


Set the valid out put directory and File name pattern

Customer%SEQ%.csv.

%SEQ% will be replaced with a sequence number i.e 1,2,3 and so on

End point - configure file write

Choose the delimited data file for file structure.

You can create a sample .csv file with following content and specify here


PartyNumber|OrganizationName|PartyUsageCode|RawPhoneNumber|EmailAddress|URL
678954325414,CustomerAB,EXTERNAL_LEGAL_ENTITY,9199199199,bm@oracle.com,www.oracle.com

  • Select the First row as header
  • Mark all Optional
  • and then select one as mandatory

End point - File contents

Review and select done

End Point - Summary


IC Messaging Service is at the left side and automatically configured to FTP connection

Now we need to configure mapping between payload received from ICM to FTP for file creation

Click the mapping update button as you see in below screen

Configure mapping

Mapping is very simple, just drag and drop all required attributes as you see in below screen. 

At the right side you can see, I created copy of Customer node by selecting Repeat Node to create header row in the file and set value of headers like PartyNumbe and OrganizationName and others

Configure Mapping 2


Next is mapping each left attribute to right attribute.

Note that all mappings must match the headers

Configure Mapping 3

After all mappings, validate by clicking validate button and close

Integration is done. 

Just close and come back to main integrations grid.



3. Activate Integration

Now lets activate it. select Enable tracing and include payload and select Activate

Activate configuration


Our first Subscribe to OIC integration is completed.

In last article we created Push to OIC integration

In next article we will create 2nd Subscribe to OIC integration for inserting same data in a database table, for this we will use OIC Agent to connect to on premises EBS database



Thank for reaching to my blog. for further information please visit below oracle library 


OIC - Subscribe to OIC - Database On-premise - Publish and Subscribe to Oracle Integration Cloud - Part-3


Subscribe to OIC



Introduction

In the last blog we created a first Subscribe to OIC integration, in this blog we are going to create 2nd Subscribed to OIC integrations that will consume payload and insert a row into on-premise database connecting through OCI Agent

Subscribe to OIC - FTP file Creation - Publish and Subscribe to Oracle Integration - Part-2


Integration to On-Premise EBS Database


In this integration, we will subscribe to the Push integration and consume it by inserting a row in on-premise database connecting through OCI Agent


1. Create OIC Agent group, download and install on-premise machine


There are 2 options you can follow.


1. I have used OIC agent connectivity and connecting with on-premise database, to continue with you can follow the simple steps described in my blog  OIC Agent (Oracle Integration Cloud Connectivity Agent for on-premise system


Otherwise, you can use any available database i.e Apex on cloud or any REST database using REST connection on OIC


to know more visit Get an Always Free APEX Service


2. Create a Database Connection
 

Create a Database connection 


From the connections under the Integration home page, click create 



Connections


Search Database



Select Adapters

Enter Database related details



Connection Details



3.  Create an Integration.


From the Integrations, under the Integration home page, click create


We will select the Type Subscribe To OIC, which has the required structure ready.




Integration Style



Enter the basic integration details


Create New Integration.



In Subscribe to OIC pattern, when you click create button, OIC will ask to select the publisher. Remember to select the publisher that we created in previous blog 

Select Use

Select a Publisher



You will now land to the below screen. We need to add the Database connection that we created earlier.

Search in right panel and drag and drop to right side what I mark the arrow.

Integration


When drop the Database connection, it will ask the table operation details provide the details as below screen shot

Endpoint Config

Select any custom table 

Database Adapter

Review and select done

Endpoint Config Summary


IC Messaging Service is at the left side and automatically configured to Database connection

Now we need to configure mapping between payload received from ICM to Database Connection for table insert operation

Click the mapping update button as you see in below screen

Integration


Mapping 1

After all mappings, validate by clicking validate button and close

Integration is done. 

Just close and come back to main integrations grid.



4. Activate Integration

Now lets activate it. select Enable tracing and include payload and select Activate


Activate Integration


Our 2nd Subscribe to OIC integration is completed.

In last article we created Push to OIC integration

Its time to test the 


Thank for reaching to my blog. for further information please visit below oracle library 


Lets test the integrations now

From the Integration home page, look for out Push to OIC integration and select play icon 

and then select Test

Test Integrations


Under the body, put the unique Organization Name and Party Number

and select Test

Push Request 1

Confirmation dialog will appear with instance id, we will track our integrations running instances.

Instance id: 1200005

Push Request 2


From the Integration homepage navigate to

Monitoring >Integration >Tracking

Notice that after the Push Integration executed, Subscribed integrations automatically executed and all went successful.

Ignore this: There is another Subscribed to OIC integration that is creating customer in Oracle Cloud Application by invoking organization rest api with ERP Cloud Adapter.


Track Instances


Lets now check the results for party number 678954325424

File is successfully created at FTP location

File Created at FTP

A new row is successfully inserted in database

Database Insert




Conclusion:

in Pub/Sub architecture, all the subscribers will always get pushed with the topic they subscribed to.


This blog preparation took me too long to prepare, otherwise when you learn and try yourself, you will find Oracle Integration Cloud provide simple and quick way of 
Message publishing through use of Oracle Integration Messaging.


Thank for reaching to my blog. for further information please visit below oracle library