From February 2019

Building Producer and Consumer Clients in go Language for Oracle Event Hub Cloud Service


CREATE AN OEH CLUSTER

Documentation here or watch following video:

When the cluster is created, go to details page and grab the connection url, which has the  format <broker1_ip>:6667,…,<brokern_ip>:6667

CREATE A TOPIC

INSTALL THE LIB

I’ve done the following (Mac):

git clone https://github.com/edenhill/librdkafka.git
cd librdkafka
./configure --prefix /usr/local
make
sudo make install (sudo make uninstall in case you want to remove the lib)

brew install librdkafka

BUILD OR GRAB A SAMPLE CLIENT

I’ve downloaded this consumer and this producer samples. Create producer.go and consumer.go files and put the sample code in each file.

go build producer.go

go build consumer.go

Test your clients:

./producer <broker1_ip>:6667,...,<brokern_ip>:6667 sample

./consumer <broker1_ip>:6667,...,<brokern_ip>:6667 consumer_example sample

kgp.png

goc

That’s all folks!

🙂 Enjoy

 

JSON Support in Oracle Database. Try It with livesql.oracle.com


livesql2

Oracle Database (relational) supports JSON very well and easy.

In this post we are creating a table, a view and a couple of indexes for storing JSON data and then querying it.

livesql1

Don’t worry if you don’t have a database for testing, Oracle gives you an environment, try here

livesql.oracle.com let you share scripts and code with the community. I’m sharing the scripts in this blog just for your convenience here

JSON DATA

The Oracle Cloud REST API for billing/metering retrieves data with the following format, let’s use it as an example:

{   "subscriptionId": "nnnnnnn",
    "subscriptionType": "PRODUCTION",
    "serviceName": "Compute",
    "resourceName": "BLOCK_STORAGE",
    "currency": "EUR",
    "gsiProductId": "B88274",
    "startTimeUtc": "2019-01-01T00:00:00.000",
    "endTimeUtc": "2019-02-01T00:00:00.000",
    "dataCenterId": "EM003",
    "serviceEntitlementId": "mmmmmmmmm",
    "costs": [{
      "computedQuantity": 1047.4112903225807,
      "computedAmount": 29.0429677444,
      "unitPrice": 0.0295,
      "overagesFlag": "N",
      "computeType": "Usage"
    }]
}

TABLE & INDEXES & VIEW

CREATE TABLE metering (id RAW (16) NOT NULL, date_loaded TIMESTAMP WITH TIME ZONE, label varchar2(20), jsonmeteringdata CLOB CONSTRAINT ensure_metering_json CHECK (jsonmeteringdata IS JSON));
CREATE BITMAP INDEX metering_servicename_idx ON metering (json_exists(jsonmeteringdata,'$.serviceName'));

CREATE BITMAP INDEX has_resourcename_idx ON metering (json_exists(jsonmeteringdata,'$.resourceName'));
create view v_metering as select met.id, met.jsonmeteringdata.startTimeUtc, met.jsonmeteringdata.endTimeUtc, met.jsonmeteringdata.serviceName, met.jsonmeteringdata.resourceName, met.jsonmeteringdata.costs.unitPrice P, met.jsonmeteringdata.costs.computedQuantity Q, met.jsonmeteringdata.costs.computedAmount Money, met.jsonmeteringdata.costs.overagesFlag Overage, met.jsonmeteringdata.costs.computeType comptype from metering met;

INSERT SOME DATA

INSERT INTO metering
VALUES (
SYS_GUID(),
SYSTIMESTAMP,
'{
    "subscriptionId": "1234567",
    "subscriptionType": "PRODUCTION",
    "serviceName": "Compute",
    "resourceName": "BLOCK_STORAGE",
    "currency": "EUR",
    "gsiProductId": "B88274",
    "startTimeUtc": "2019-01-01T00:00:00.000",
    "endTimeUtc": "2019-02-01T00:00:00.000",
    "dataCenterId": "EM003",
    "serviceEntitlementId": "123456789",
    "costs": [{
      "computedQuantity": 1047.4112903225807,
      "computedAmount": 29.0429677444,
      "unitPrice": 0.0295,
      "overagesFlag": "N",
      "computeType": "Usage"
    }]
  }'
);

QUERY THE DATA

select met.id, met.jsonmeteringdata.startTimeUtc, met.jsonmeteringdata.endTimeUtc, met.jsonmeteringdata.serviceName, met.jsonmeteringdata.resourceName, met.jsonmeteringdata.costs.unitPrice P, met.jsonmeteringdata.costs.computedQuantity Q, met.jsonmeteringdata.costs.computedAmount Money, met.jsonmeteringdata.costs.overagesFlag Overage, met.jsonmeteringdata.costs.computeType comptype from metering met;
select count(*) from met;
This is how it looks like in livesql.oracle.com
livesql
As you can see, it is very easy to query JSON data. Now you have all the power of SQL for reporting, aggregates and many other such as full test search and more.
Enjoy 😉

jMeter Test Script for Kafka (tested against Oracle Event Hub Cloud Service)


In this post we are testing a jMeter script that sends messages to Kafka Cluster running in Oracle Event Hub (OEH).

jMETER CONFIG

Install plugins manager in JMeter if you don’t have it, restart jMeter and then install Kafka Support, then you will be told to restart jMeter.

a1

jMETER SCRIPT

Download the jMeter script from here

Load the script into jMeter and change the configuration of your cluster, topic name, etc..

a3

Change the “View Results Tree” configuration ( it comes with theErrors Check enabled in order to avoid latencies in test execution, because the nature of this especific listener ). Execute a few test cycles and observe that valid son files are sent to Kafka cluster.

a2.png

Once you are ready, put the checkbox in Errors and execute the script, here you can watch a video with my test. It has been rum from my local network to cloud, therefore latencies are degrading performance.

 

That’s all folks!

Enjoy 😉

Connecting Oracle Integration Cloud (OIC) to Oracle ERP Cloud


Oracle Integration Cloud (OIC) is a platform that allows to orchestrate integrations between different systems in a simple way, using low code paradigms. In this post we will explain how to connect OIC to ERP. For this we need an ERP instance and an OIC instance and execute the following steps.

Create a connection to ERP REST Services

The main thing here is provide the url, which is as follows:

https://<whatever>.oraclecloud.com/fscmRestApi

k10

This slideshow requires JavaScript.

Create a connection to ERP SOAP Web Services

m1

https://<wahtever>.oraclecloud.com/fndAppCoreServices/ServiceCatalogService?WSDL

https://<wahtever>.oraclecloud.com/soa-infra

This slideshow requires JavaScript.

Security Policy: Username Password Token With PGP Key Support

Enjoy 😉

 

Embedding Process Forms in your Applications


processform2

Process Forms are user interface data entry pages associated with (BPM) Processes built with Oracle Integration Cloud (OIC). In OIC you can create:

  • Integrations, which are orchestrations steps that conform a business transaction that involves several subsistems
  • Processes, which are integrations that have user tasks (human-machine dialog)
  • Decision Models, which are mechanisms for creating decisions and rules such as Decision Tables, Expressions, If-Then-Else, Functions, Contexts, Relations and Lists
  • Visual Builder, which is a “low code (citizen programming)” visual HTML5/JavaScript/CSS3 development environment

Process Forms can be embedded in your customs applications easily, for that purpose you must first create and deploy a Process in OIC.

processform1

 

Once you have your Process Application deployed open a new bowser tab or window and type https://<urlbaseofyourOICinstance>/ic/pub/components

The Integration Cloud Embeddable Process UI Components is a web application that helps you compose the code needed for integrating the Process Form in your custom application.

j5

j4

Enjoy 😉

 

How to Secure User Access to Internet-Faced Cloud Solutions


internet screen security protection
Photo by Pixabay on Pexels.com

Suppose you are in charge for the security of a bank (CISO, CSO,…) that wants to control the access of users to the new ERP in the cloud that you are implementing.

There is a very simple and safe way to control which users access the environment.
Simply configure the Single Sign On of the cloud solution side so that the Service Provider is the ERP, and the Identity Provider is your on-premises identity management infrastructure.

How does it work?

When a user requests the url of the ERP, a login form hosted on the corporate servers appears, requesting the credentials. Since this form is deployed on-premises, only users connected to the corporate network (directly or via VPN) can access it.

fedsso
Oracle Identity Cloud is always provisioned when you buy clod services and allows you to configure, among other things, the following:

  • federate users between the cloud and LDAP on premises without the need to store the password in the cloud
  • configure the SSO provided by the on-premises access system
  • configure several authentication factors (MFA) for administrators
  • define network perimeters (ranges of IP’s that can access the cloud)
  • define Risk Providers and Adaptative Security, which are mechanisms to evaluate the risk in user access actions
  • define Sign On policies, which are rules that apply in different way depending on the user roles (the more powered user the more strong rules to apply)
  • out of the box reports with login attempts and application access

In addition to the out of the box features that IDCS (Identity Cloud Service) mentioned above, Oracle provides CASB (Cloud Access Security Broker)

Enjoy 😉